Bug 120457 - gcc prints warning twice
Summary: gcc prints warning twice
Status: VERIFIED WONTFIX
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Development (show other bugs)
Version: RC 4
Hardware: x86 Linux
: P5 - None : Minor
Target Milestone: ---
Assignee: Thorsten Kukuk
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-05 18:17 UTC by Jan Engelhardt
Modified: 2007-09-27 15:49 UTC (History)
1 user (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Testcase (143 bytes, text/plain)
2005-10-05 18:30 UTC, Jan Engelhardt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Engelhardt 2005-10-05 18:17:28 UTC
GCC prints the warning twice even though it should only be once, testcase attached.
Comment 1 Jan Engelhardt 2005-10-05 18:30:41 UTC
Created attachment 51534 [details]
Testcase
Comment 2 Marcus Meissner 2005-10-06 07:57:04 UTC
i guess it is better to open a upstream gcc bugzilla entry. ;) 
Comment 3 Michael Matz 2005-10-06 13:44:24 UTC
The problem is the glibc header /usr/include/stdio.h:     
 extern int snprintf (char *__restrict __s, size_t __maxlen,    
       __const char *__restrict __format, ...)    
     __attribute__ ((__nothrow__))    
     __attribute__ ((__format__ (__printf__, 3, 4)));    
  
I.e. the glibc header explicitely defines a __format__ attribute for  
snprintf.  But GCC has already an internal format attribute for this function  
(like for printf itself for instance, where the header doesn't add such  
attribute).  GCC simply goes over the list of all attributes and checks  
for each of them.  In the snprintf case both attributes have the same 
arguments, but that is nothing GCC checks, so it checks and warns about 
the same thing twice. 
 
Needs to be changed in glibc, hence reassigning. 
Comment 4 Thorsten Kukuk 2005-10-06 13:46:41 UTC
If somebody don't like that, he is free to discuss that with Uli. I will not
change that.