[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#138201: cpp: macro expansion inside macro calling



Package: cpp
Version: 2:2.95.4-9
Severity: wishlist

For example, if a define two macros:

#define a_bit P4,0x08
#define setbit(port,bit) port ## OUT |= bit

And, considering the following line (source code):

setbit(a_bit);

It will generate an error: "macro `setbit' used with just one arg"

It occurs because a_bit will be expanded after setbit. Ok, it would be
desirable in some situations, but in this case, it may be better if
a_bit would be expanded first.

Please, let me know if I am doing anything wrong, if there is a way to
do something similar to that. Thanks!

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux mantis 2.2.19 #1 Sat Oct 20 18:09:49 EST 2001 i686
Locale: LANG=pt_BR, LC_CTYPE=pt_BR

Versions of packages cpp depends on:
ii  cpp-2.95                      1:2.95.4-1 The GNU C preprocessor.



Reply to: