www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23693] New: compilable/testcstuff3.i:7:1: error: stray '#' in

https://issues.dlang.org/show_bug.cgi?id=23693

          Issue ID: 23693

                    program
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

When compiling the test with `gcc -std=c11 -fsyntax-only`


    7 | #line 1050 "cstuff3.c" extra tokens ignored (should warn?)
      | ^
compilable/testcstuff3.i:7:7: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or
‘__attribute__’ before numeric constant
    7 | #line 1050 "cstuff3.c" extra tokens ignored (should warn?)
      |       ^~~~

   10 | #line 1000
      | ^
compilable/testcstuff3.i:11:1: error: stray ‘%:’ in program
   11 | %:line 1010
      | ^~
compilable/testcstuff3.i:13:22: error: invalid flag "2" in line directive

      |                      ^


      |                        ^

Original test content:
```

/* cpp doesn't like this, so don't run preprocessor on this file
 */

/********************************/

#line 1050 "cstuff3.c" extra tokens ignored (should warn?)


#line 1000
%:line 1010



struct S21944
{
    int var;

};

_Static_assert(U'\U00011234' == 0x11234, "ok"); // sppn.exe doesn't support U
character literals
```

--
Feb 12 2023