Bug 22343 - ## gives erronous warnings in variable arguments macro expansions
Summary: ## gives erronous warnings in variable arguments macro expansions
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-12-15 13:51 UTC by Need Real Name
Modified: 2007-04-18 16:30 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-12-15 13:51:38 UTC
Embargoed:


Attachments (Terms of Use)

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).


Note You need to log in before you can comment on or make changes to this bug.