preprocessor/6780: Incorrect diagnosis of token pasting

loewis@informatik.hu-berlin.de loewis@informatik.hu-berlin.de
Thu May 23 03:06:00 GMT 2002


>Number:         6780
>Category:       preprocessor
>Synopsis:       Incorrect diagnosis of token pasting
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 23 03:06:01 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:
	When compiling the program

#define inc2(a,b) <##a##.##b##>
#define INC(X) inc2(X,h)
#include INC(stdio)

int main()
{
  printf("Hallo");
}

	gcc gives the warning

	warning: pasting "<stdio>" and "." does not give a valid preprocessing token
	This warning is incorrect: There is no token <stdio> (with starting
	and terminating angle bracket) created during pasting. It is not clear
	whether the compiler really created such a token, or whether it just
	reports it in the error message.

>How-To-Repeat:
	Compile the above code.
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list