Bug 120457

Summary: gcc prints warning twice
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Jan Engelhardt <jengelh>
Component: DevelopmentAssignee: Thorsten Kukuk <kukuk>
Status: VERIFIED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: meissner
Version: RC 4   
Target Milestone: ---   
Hardware: x86   
OS: Linux   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Testcase

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.