public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* "warning: preprocessor directive not recognised within macro arg"(fwd)
@ 2000-03-15 17:10 Mo McKinlay
  2000-03-15 17:20 ` "warning: preprocessor directive not recognised within macro arg" (fwd) Zack Weinberg
  0 siblings, 1 reply; 5+ messages in thread
From: Mo McKinlay @ 2000-03-15 17:10 UTC (permalink / raw)
  To: gcc

Hi folks,

I've been compiling the Open Look libraries for Linux (xview-3.2p1), and
ran up against the above warning followed by "unmatched #ifdef" errors.

I can fix the sources, no problem, but I was wondering if there was any
plans to support preprocessor directives within macro expansions? For
example:

#define xstrncpy(a, b, n)   strcpy(a, b)

void myfunc(char *a) {
	xstrcpy(a,
#ifdef SOME_OPTION
		some_function(),
#else
		"Some text",
#endif
		n);

With gcc 2.95.2, compilation would fail with:

bug.c:8: warning: preprocessor directive not recognised within macro arg
bug.c:8: warning: preprocessor directive not recognised within macro arg
bug.c:8: unbalanced #endif

Just to clarify, I know the sources can be fixed easily, I was merely
wondering if there are any plans to make this work without requiring
source changes. I've not tried development snapshots, so I have no idea
about the state of this "feature" in newer releases :-)

Many thanks.

-- 
Mo McKinlay                                T: +44 (0) 709 22 55 05  x1
Chief Software Architect                   F: +44 (0) 709 22 55 05  x3
inter/open                                 E: mmckinlay@labs.interopen.org
A division of Bekon Marketing Limited      W: http://www.interopen.org


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-03-16 14:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-15 17:10 "warning: preprocessor directive not recognised within macro arg"(fwd) Mo McKinlay
2000-03-15 17:20 ` "warning: preprocessor directive not recognised within macro arg" (fwd) Zack Weinberg
2000-03-15 17:25   ` "warning: preprocessor directive not recognised within macroarg" (fwd) Mo McKinlay
2000-03-16 14:55     ` "warning: preprocessor directive not recognised within macro arg" (fwd) Zack Weinberg
2000-03-16 14:58       ` "warning: preprocessor directive not recognised within macroarg" (fwd) Mo McKinlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).