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

* Re: "warning: preprocessor directive not recognised within macro arg" (fwd)
  2000-03-15 17:10 "warning: preprocessor directive not recognised within macro arg"(fwd) Mo McKinlay
@ 2000-03-15 17:20 ` Zack Weinberg
  2000-03-15 17:25   ` "warning: preprocessor directive not recognised within macroarg" (fwd) Mo McKinlay
  0 siblings, 1 reply; 5+ messages in thread
From: Zack Weinberg @ 2000-03-15 17:20 UTC (permalink / raw)
  To: Mo McKinlay; +Cc: gcc

On Thu, Mar 16, 2000 at 01:09:58AM +0000, Mo McKinlay wrote:
> 
> 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?

No, there are not.  I sympathize with your problem, but there are
_serious_ implementation difficulties, and we have too many extensions
already (this code is illegal C).  Please see
http://gcc.gnu.org/fom_serv/cache/29.html .

zw

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

* Re: "warning: preprocessor directive not recognised within macroarg" (fwd)
  2000-03-15 17:20 ` "warning: preprocessor directive not recognised within macro arg" (fwd) Zack Weinberg
@ 2000-03-15 17:25   ` Mo McKinlay
  2000-03-16 14:55     ` "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:25 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

# No, there are not.  I sympathize with your problem, but there are
# _serious_ implementation difficulties, and we have too many extensions
# already (this code is illegal C).  Please see
# http://gcc.gnu.org/fom_serv/cache/29.html .

Okay, that's fine with me - I was asking out of curiosity more than
anything, as I've never written (and don't intend to write) code that
utilitises preprocessor directives within macro expansions. Interestingly,
it's the first time I've encountered this particular error - and from such
a repuatble source as Sun no less! Shame on them! :-)

-- 
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

* Re: "warning: preprocessor directive not recognised within macro arg" (fwd)
  2000-03-15 17:25   ` "warning: preprocessor directive not recognised within macroarg" (fwd) Mo McKinlay
@ 2000-03-16 14:55     ` Zack Weinberg
  2000-03-16 14:58       ` "warning: preprocessor directive not recognised within macroarg" (fwd) Mo McKinlay
  0 siblings, 1 reply; 5+ messages in thread
From: Zack Weinberg @ 2000-03-16 14:55 UTC (permalink / raw)
  To: Mo McKinlay; +Cc: gcc

On Thu, Mar 16, 2000 at 01:24:50AM +0000, Mo McKinlay wrote:
> 
> # No, there are not.  I sympathize with your problem, but there are
> # _serious_ implementation difficulties, and we have too many extensions
> # already (this code is illegal C).  Please see
> # http://gcc.gnu.org/fom_serv/cache/29.html .
> 
> Okay, that's fine with me - I was asking out of curiosity more than
> anything, as I've never written (and don't intend to write) code that
> utilitises preprocessor directives within macro expansions. Interestingly,
> it's the first time I've encountered this particular error - and from such
> a repuatble source as Sun no less! Shame on them! :-)

Ha, ha... You haven't worked with Solaris much, have you?  :)

[insert the FAQ about C++ and the X11 headers Sun ships here].

zw

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

* Re: "warning: preprocessor directive not recognised within macroarg" (fwd)
  2000-03-16 14:55     ` "warning: preprocessor directive not recognised within macro arg" (fwd) Zack Weinberg
@ 2000-03-16 14:58       ` Mo McKinlay
  0 siblings, 0 replies; 5+ messages in thread
From: Mo McKinlay @ 2000-03-16 14:58 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

# Ha, ha... You haven't worked with Solaris much, have you?  :)

As little as possible :) It was a while ago, and I do remember having
problems - although made easier by using gcc instead of ProWorks (or
whatever). Mind you, I never had to compile Sun libraries under Solaris,
which is probably why I didn't run into quite this sort of problem before.

Caveat emptor, and all that :)

-- 
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).