Bug 22343

Summary: ## gives erronous warnings in variable arguments macro expansions
Product: [Retired] Red Hat Linux Reporter: Need Real Name <hno>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-12-15 13:51:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2000-12-15 13:51:36 UTC
--- t.c ---
#define NULL ((void *)0L)
void debug_Error(char *expr, char *fmt, ...)
{
}
#define Error(expr, message...)\
        ((expr) ? 0 : (debug_Error(  #expr, __FILE__, __LINE__,
__PRETTY_FUNCTION__, 1 , ## message, NULL), 1))

int main(int argc, char **argv) {
    Error(0, "URL data has invalid (not hexadecimal) value.");
}
--- end of t.c ---

Compiling this test program gives the warning
t.c:9:61: warning: pasting would not give a valid preprocessing token

Works fine without a warning in GCC 2.95.2 (SuSE 7.0) and EGCS 2.91.66
(RedHat 6.2)

rpm -q gcc
gcc-2.96-54

Comment 1 Jakub Jelinek 2000-12-15 14:36:38 UTC
This is fixed since I think cpp-2.96-55 (definitely in rawhide current cpp
packages).