Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#95 #include does not work with macro

open
semantic (53)
5
2009-08-30
2009-08-30
Anonymous
No

Semantic does not recognize following as include:

main.c:
#define FOO "inc.h"
#include FOO

inc.h:
int test(int arg);

"Summarize includes" reports:
"This file contains 1 tags, 0 of which are includes."

Discussion

  • Eric M. Ludlam
    Eric M. Ludlam
    2009-08-30

    #includes are handled via regexp, not a series of lexical tokens. The C lexer will need to be rebuilt to avoid the cheat in there right now.

     
  • Eric M. Ludlam
    Eric M. Ludlam
    2009-08-30

    • assigned_to: nobody --> zappo
     
  • Could it be possible to write a regexp to match "#include anything else" and
    then do macro expansion for "anything else?. At least gnu cpp seems to work this way: http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC6