From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31907 invoked by alias); 23 May 2002 10:26:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 31886 invoked by uid 71); 23 May 2002 10:26:01 -0000 Resent-Date: 23 May 2002 10:26:01 -0000 Resent-Message-ID: <20020523102601.31885.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, loewis@informatik.hu-berlin.de Received:(qmail 29251 invoked from network); 23 May 2002 10:16:12 -0000 Received: from unknown (HELO mail.informatik.hu-berlin.de) (141.20.20.50) by sources.redhat.com with SMTP; 23 May 2002 10:16:12 -0000 Received: from paros.informatik.hu-berlin.de (paros [141.20.23.39]) by mail.informatik.hu-berlin.de (8.11.3/8.11.3/INF-2.0-MA-SOLARIS-2.8) with ESMTP id g4NAGB100065; Thu, 23 May 2002 12:16:11 +0200 (MEST) Received: (from loewis@localhost) by paros.informatik.hu-berlin.de (8.12.1+Sun/8.12.1/Submit) id g4NAGB0C010211; Thu, 23 May 2002 12:16:11 +0200 (CEST) Message-Id:<200205231016.g4NAGB0C010211@paros.informatik.hu-berlin.de> Date: Thu, 23 May 2002 03:26:00 -0000 From: loewis@informatik.hu-berlin.de To: gcc-gnats@gcc.gnu.org Cc: boehme@informatik.hu-berlin.de X-Send-Pr-Version:3.113 Subject: preprocessor/6781: Creating header-names is not possible X-SW-Source: 2002-05/txt/msg00716.txt.bz2 List-Id: >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: