Author Topic: Strip the comment when parse a macro  (Read 6285 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Strip the comment when parse a macro
« on: May 05, 2010, 03:30:46 pm »
Code
#ifndef _HAS_EXCEPTIONS
    #define  _HAS_EXCEPTIONS  1 /* predefine as 0 to disable exceptions */
#endif /* _HAS_EXCEPTIONS */

#define AAA 1
#define BBB 2
#define CCC 3

#define DDD AAA/*c style comment*/ + BBB \ /*test*/  \
    - CCC // c++ style comment

int main()
{
    return 0;
}

In this demo, we can't strip the comment when parser a macro.
Like this.

I make a patch for fix it.

[attachment deleted by admin]
« Last Edit: May 05, 2010, 03:33:49 pm by Loaden »