This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

#message

Hi,
Does anyone here ever use #message in other compilers?

It is a useful tool for making sure that code with many #ifdef compiles the way you want without adding to the number of warnings.


thanks,
Martin

Parents
  • At the top of your code you have the following #defines

    Hold it right there. You're causing yourself problems you don't need by doing it this way. Definitions of macros used to control build features of the code don't belong into the source code itself. Once they're in there, they're needlessly hard to get out again, as you're just finding out.

    I would strongly suggest you use flags passed to the compiler on its invocation instead (-DDEBUG=1 etc., for most C compilers). That way, they'll be plainly visible to you in the make run's screen output (and in the .lst file, too). The visible hint won't be quite as wordy as your #message, but it's right there in front of your eyes.

    In uV2 you would use multiple targets in the same project, using the same set of source files, but with different flags each, to achieve the same effect.

Reply
  • At the top of your code you have the following #defines

    Hold it right there. You're causing yourself problems you don't need by doing it this way. Definitions of macros used to control build features of the code don't belong into the source code itself. Once they're in there, they're needlessly hard to get out again, as you're just finding out.

    I would strongly suggest you use flags passed to the compiler on its invocation instead (-DDEBUG=1 etc., for most C compilers). That way, they'll be plainly visible to you in the make run's screen output (and in the .lst file, too). The visible hint won't be quite as wordy as your #message, but it's right there in front of your eyes.

    In uV2 you would use multiple targets in the same project, using the same set of source files, but with different flags each, to achieve the same effect.

Children
No data