public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/6781: Creating header-names is not possible
@ 2002-05-23 7:26 Martin v. Löwis
0 siblings, 0 replies; 5+ messages in thread
From: Martin v. Löwis @ 2002-05-23 7:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR preprocessor/6781; it has been noted by GNATS.
From: loewis@informatik.hu-berlin.de (Martin v. =?iso-8859-1?q?L=F6wis?=)
To: neil@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/6781: Creating header-names is not possible
Date: 23 May 2002 16:16:17 +0200
neil@gcc.gnu.org writes:
> Sorry, my mistake.
>
> #define inc2(a,b) <a.b>
>
> should work I think.
That works fine indeed.
Thanks,
Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: preprocessor/6781: Creating header-names is not possible
@ 2002-05-23 9:38 neil
0 siblings, 0 replies; 5+ messages in thread
From: neil @ 2002-05-23 9:38 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, loewis, nobody
Synopsis: Creating header-names is not possible
State-Changed-From-To: feedback->closed
State-Changed-By: neil
State-Changed-When: Thu May 23 09:38:24 2002
State-Changed-Why:
Can be done in a different way.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6781
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: preprocessor/6781: Creating header-names is not possible
@ 2002-05-23 3:53 neil
0 siblings, 0 replies; 5+ messages in thread
From: neil @ 2002-05-23 3:53 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, loewis, nobody
Synopsis: Creating header-names is not possible
State-Changed-From-To: closed->feedback
State-Changed-By: neil
State-Changed-When: Thu May 23 03:53:55 2002
State-Changed-Why:
Sorry, my mistake.
#define inc2(a,b) <a.b>
should work I think.
Neil.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6781
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: preprocessor/6781: Creating header-names is not possible
@ 2002-05-23 3:49 neil
0 siblings, 0 replies; 5+ messages in thread
From: neil @ 2002-05-23 3:49 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, loewis, nobody
Synopsis: Creating header-names is not possible
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Thu May 23 03:49:32 2002
State-Changed-Why:
I have no intention of changing this behaviour (the
diagnostic in your other PR excepted).
The correct fix is for you to do you the correct and
portable macro
#define inc2(a,b) <a.##b>
and everything should work. If it doesn't, let me know.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6781
^ permalink raw reply [flat|nested] 5+ messages in thread
* preprocessor/6781: Creating header-names is not possible
@ 2002-05-23 3:26 loewis
0 siblings, 0 replies; 5+ messages in thread
From: loewis @ 2002-05-23 3:26 UTC (permalink / raw)
To: gcc-gnats; +Cc: boehme
>Number: 6781
>Category: preprocessor
>Synopsis: Creating header-names is not possible
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu May 23 03:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.1
>Organization:
HUB
>Environment:
System: SunOS paros 5.9 Beta_Refresh sun4u sparc SUNW,Sun-Blade-1000
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../configure --host=sparc-sun-solaris2.8 --enable-shared --enable-threads --with-cpu=v8 --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs
>Description:
The code
#define inc2(a,b) <##a##.##b##>
#define INC(X) inc2(X,h)
#include INC(stdio)
int main()
{
printf("Hallo");
}
first gives a warning, then reports
stdio: No such file or directory
The intent of this code is to create a header-name token (2.8)
through token pasting. In an pedantic interpretation, this invokes
undefined behaviour, since it creates intermediate tokens which are
invalid preprocessing tokens.
GCC should support this code as an extension (performing an #include
of stdio.h), and only warn about this problem when pedantic (since it
is undefined behaviour, no diagnostics is required by the standard).
More specifically, it normally should only emit the warning if
interpreting the full ## sequence produces an invalid token.
Havin this extension is desirable, because
a) nearly every other compiler supports it (even though just because
the compilers fail to notice the problem);
b) this is the best approach to deal with portability of CORBA applications,
where different IDL compilers emit differently named header files.
>How-To-Repeat:
Compile the included program.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-05-23 16:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-23 7:26 preprocessor/6781: Creating header-names is not possible Martin v. Löwis
-- strict thread matches above, loose matches on Subject: below --
2002-05-23 9:38 neil
2002-05-23 3:53 neil
2002-05-23 3:49 neil
2002-05-23 3:26 loewis
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).