After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683696 - cc-printers-panel.c fails to compile; error: redefinition of typedef ‘UserResponseCallback’
cc-printers-panel.c fails to compile; error: redefinition of typedef ‘UserRes...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
git master
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-10 04:42 UTC by Nirbheek Chauhan
Modified: 2012-09-10 13:56 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6



Description Nirbheek Chauhan 2012-09-10 04:42:18 UTC
This is with gcc-4.5 and gnome-control-center trunk.

In file included from cc-printers-panel.c:37:0:
pp-options-dialog.h:31:16: error: redefinition of typedef ‘UserResponseCallback’
pp-ppd-selection-dialog.h:32:16: note: previous declaration of ‘UserResponseCallback’ was here
In file included from cc-printers-panel.c:38:0:
pp-jobs-dialog.h:31:16: error: redefinition of typedef ‘UserResponseCallback’
pp-options-dialog.h:31:16: note: previous declaration of ‘UserResponseCallback’ was here
make[3]: *** [cc-printers-panel.lo] Error 1

I believe that with gcc-4.6, re-declaration of identical typedefs is not an error. But with earlier versions of gcc, it is. The following headers declare `UserResponseCallback`:

panels/printers/pp-ppd-selection-dialog.h
panels/printers/pp-options-dialog.h
panels/printers/pp-jobs-dialog.h

What I thought of was to separate out the declaration into another header file and then include that in these headers, but I'm not sure to create another file, reuse another file, or even whether this is a good idea.
Comment 1 Bastien Nocera 2012-09-10 13:56:10 UTC
commit 0a0bc59afacc08fe0ec6378a7171eb3fdb549fe3
Author: Bastien Nocera <hadess@hadess.net>
Date:   Mon Sep 10 14:55:04 2012 +0100

    printers: Avoid redefinition of UserResponseCallback
    
    It was declared to be the same value in all three headers, which
    causes problems with old version of GCC.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683696