This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
is this legal C?
- From: Sam Steingold <sds at gnu dot org>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 14 May 2004 13:28:03 -0400
- Subject: is this legal C?
- Organization: disorganization
- Reply-to: sds at gnu dot org
suppose BAR is defined and QWE is not.
does the following do what I expect it to:
struct { char* name; } foo [] = {
{ "ABC"
#if defined(BAR)
"ZZZ"
#endif
},{
#if defined(QWE)
"ZOO"
#endif
"XYZ"
}}
i.e., create an array of length 2 with elements named "ABCZZZ" and
"XYZ"? (it does, with GCC)
is this portable?
is this legal ANSI C?
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
To understand recursion, one has to understand recursion first.