public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: loewis@informatik.hu-berlin.de
To: gcc-gnats@gcc.gnu.org
Cc: boehme@informatik.hu-berlin.de
Subject: preprocessor/6781: Creating header-names is not possible
Date: Thu, 23 May 2002 03:26:00 -0000	[thread overview]
Message-ID: <200205231016.g4NAGB0C010211@paros.informatik.hu-berlin.de> (raw)


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


             reply	other threads:[~2002-05-23 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-23  3:26 loewis [this message]
2002-05-23  3:49 neil
2002-05-23  3:53 neil
2002-05-23  7:26 Martin v. Löwis
2002-05-23  9:38 neil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200205231016.g4NAGB0C010211@paros.informatik.hu-berlin.de \
    --to=loewis@informatik.hu-berlin.de \
    --cc=boehme@informatik.hu-berlin.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).