Re: Macro redefinition
- From: Tor Rustad <tor_rustad@xxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 22:21:33 +0200
Ben Pfaff wrote:
Tor Rustad <tor_rustad@xxxxxxxxxxx> writes:Tor Rustad <tor_rustad@xxxxxxxxxxx> writes:Doesn't theDave Hansen wrote:Is really the #undef needed in this case? This is a function-likeMy question is simply, is the above C code allowed?It's a pretty common idiom in the code I work with. One caveat:
don't
forget to #undef EXPAND_DEF before redefining it.
macro, and the re-definition had identical argument list.
"unless the second definition is a function-like macro definition that
has the same number and spelling of parameters, and the two
replacement lists are identical"
apply?
Your replacement lists are different: the first has
generate_source_1, the second has generate_source_2.
Ahh.. I see and learned something new! :-)
--
Tor <torust [at] online [dot] no>
.
- References:
- Macro redefinition
- From: Tor Rustad
- Re: Macro redefinition
- From: Dave Hansen
- Re: Macro redefinition
- From: Tor Rustad
- Re: Macro redefinition
- From: Keith Thompson
- Re: Macro redefinition
- From: Tor Rustad
- Re: Macro redefinition
- From: Ben Pfaff
- Macro redefinition
- Prev by Date: Re: Porting C software
- Next by Date: Re: Porting C software
- Previous by thread: Re: Macro redefinition
- Next by thread: Re: Macro redefinition
- Index(es):