This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cpp problem found by imake
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: cpp problem found by imake
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Tue, 2 May 2000 09:05:36 -0700
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20000502180258.J540@sunsite.ms.mff.cuni.cz>
On Tue, May 02, 2000 at 06:02:58PM +0200, Jakub Jelinek wrote:
> Hi!
>
> Current cpp does not also like the following snippet
> (distilled from XF4.0 cf/ stuff):
>
> #define Concat3(a,b,c) a##b##c
> #define Header /usr/include/stdio
> #define Include Concat3(<,Header,.h>)
> #include Include
This came up before. It's undefined behavior - token paste produces
an illegal token. They should do something like
#define Header /usr/include/stdio
#define HNAME(x) _HNAME(x.h)
#define _HNAME(x) #x
#define Include HNAME(Header)
#include Include
Note that the HP/UX and Irix cc are reported to reject this construct too.
[I know there is a bug in that the special treatment of <...> extends
to macros expanded on the #include line, but this particular example
is still undefiend behavior.]
zw