#2055 Preprocessor Macro gets undefined when source directory is same as macro name

OTHER
upstream
nobody
gcc (462)
Support
none
component_package
False
2013-09-19
2013-09-19
adite
No

Content of file src/test.c:

#ifndef SRC
# error SRC not defined!
#endif

When precompiled from parent directory:

cpp -P -DSRC src/test.c

src/test.c:3:3: error: #error SRC not defined!
# error SRC not defined!
^

There seems to be conflict between the macro named 'SRC' and the directory 'src'.

Tested with MinGW - cpp 4.8.1 under Windows 7.
Other distributions seems to work with same version (www.josuegomes.com)

Thank you
Adrian

Discussion

  • Earnie Boyd
    Earnie Boyd
    2013-09-19

    • labels: --> gcc
    • Type: Bug --> Support
    • Category: Unknown --> component_package
     
  • Earnie Boyd
    Earnie Boyd
    2013-09-19

    Please open a bug report with GCC bugs.

     
    • Earnie Boyd
      Earnie Boyd
      2013-09-19

      Note, other distributions may have modified the source in some fashion. We used the upstream source without any specific patch that would have caused this issue. The only patch that was applied to the source affected the build of the Ada compiler.

       
  • Earnie Boyd
    Earnie Boyd
    2013-09-19

    • status: unread --> upstream
     
  • adite
    adite
    2013-09-19

    I opened a bug 58468