Bug 80092 - gtk+-devel headers generate warnings with -Wstrict-prototypes
Summary: gtk+-devel headers generate warnings with -Wstrict-prototypes
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gtk+ (Show other bugs)
(Show other bugs)
Version: 8.0
Hardware: All Linux
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-19 21:13 UTC by Wagner T. Correa
Modified: 2007-04-18 16:49 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-01-10 03:53:37 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Wagner T. Correa 2002-12-19 21:13:41 UTC
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):

How reproducible:

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:


Comment 1 Owen Taylor 2003-01-02 14:23:55 UTC
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-10 03:42:57 UTC
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

Comment 3 Owen Taylor 2003-01-10 03:53:37 UTC
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.