Author Topic: add a substitution field for preprocessor MACROS  (Read 3457 times)

Wade Brooks

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
add a substitution field for preprocessor MACROS
« on: February 06, 2015, 07:10:35 am »
EA define preprocessors default of replacing with nothing works most of the time. But if you hit macros with arguments, it is not so good.  I would like to be able to specify the substituted value and '//' would be a good choice for most MACROS with arguments.   Just ignoring the MACRO, still leaves the parameter list in the way of the parser.

I hate making changes below to source code:
from:
[size=9]IGNORE_FLAGS("-Weffc++") // Ignore base class 'class PtrQueue' has a non-virtual destructor
template <class T>
[/size]
to:
[size=9]#define EA_UGLY     IGNORE_FLAGS("-Weffc++") // Ignore base class has a non-virtual destructor
EA_UGLY
template <class T>
[/size]

« Last Edit: February 06, 2015, 07:31:01 am by WadeBrooks »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: add a substitution field for preprocessor MACR
« Reply #1 on: February 06, 2015, 08:36:35 am »
If you add IGNORE_FLAGS() to the macro list EA will handle that already.

Wade Brooks

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: add a substitution field for preprocessor MACR
« Reply #2 on: February 06, 2015, 09:51:02 am »
Thank you, I feeling much better about EA again.  I had tried it leaving the text in the parenthesis, but after seeing your answer I feel dumb again.      Thanks a bunch

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: add a substitution field for preprocessor MACR
« Reply #3 on: February 06, 2015, 11:51:06 am »
The other situation that it handles is skipping entire blocks: BEGIN_NON_CODE ^ END_NON_CODE

There are still situations where it would be good. But they are a little less common. eg. I've seen things like # __INTERFACE struct, and parent names being macros.