Welcome, Guest. Please login or register.

Author Topic: Varargs macros...  (Read 1074 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: Varargs macros...
« on: February 02, 2007, 08:08:10 PM »
Regarding the problems you are having with the macros, you have to remember, the preprocessor has absolutely no knowledge of C; it will happily expand macros that generate totally meaningless code for the compiler to complain about.

That said, I've never encountered problems* using function-like macros within other function-like macros, provided they are #defined in the proper order.

*except for the obvious "hmm, that didn't quite expand as intended" bugs that required me to go back in and fix them.

No lectures about C++ this time. I'm sure you'll know better for your next project ;-)
int p; // A