Bug 80092 - gtk+-devel headers generate warnings with -Wstrict-prototypes
gtk+-devel headers generate warnings with -Wstrict-prototypes
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gtk+ (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Owen Taylor
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-19 16:13 EST by Wagner T. Correa
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-09 22:53:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wagner T. Correa 2002-12-19 16:13:41 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212

Description of problem:
Some gtk+-devel headers generate warnings when I compile them with the
-Wstrict-prototypes flag.


Version-Release number of selected component (if applicable):
gtk+-devel-1.2.10-22

How reproducible:
Always

Steps to Reproduce:
1. #include <gtk/gtk.h> from a C program
2. compile the C program with the -Wstrict-prototypes flag


Actual Results:  /usr/include/gtk-1.2/gtk/gtktypeutils.h:163: warning: function
declaration isn't a prototype

/usr/include/gtk-1.2/gtk/gtkitemfactory.h:48: warning: function declaration
isn't a prototype


Expected Results:  These headers should be warning free.

Additional info:

gcc-3.2-7
Comment 1 Owen Taylor 2003-01-02 09:23:55 EST
Nothing can be done about this in the short term ... the problem is that changing
the offending prototype would break source and/or (for C++) binary compatibility.

Comment 2 Wagner T. Correa 2003-01-09 22:42:57 EST
The fix is very simple: just replace () with (void). I don't think that would
break binary compatibility, since those functions are declared extern "C".

Many other functions in those files are properly declared using (void). So it
seems that the programmer just forgot to put the keyword void in those two
declarations.
Comment 3 Owen Taylor 2003-01-09 22:53:37 EST
A) No, the () was intentional; the person who added it was trying
   to be clever. Changing it would break C API compatibility
   because () is different than (void) in C.

B) The C++ ABI compatibility issue is tricker; but we saw it
   when we made a similar change elsewhere inside GTK+ a
   couple of years ago.

   I believe that the issue is that some older versions of GCC
   incorrectly treat () occuring inside extern "C" {} in the
   C fashion. (The C standard says that the interpretation of
   () is not affected by extenr "C".) So changing () to (void) 
   is the same as changing (...) to (void) which changes mangling.

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