OpenSolaris

Printable Version Enter a New Search
Bug ID 6783790
Synopsis G_GNUC_INTERNAL macro only supported when putting it in front of the function declaration
State 10-Fix Delivered:Verified (Fix available in build)
Category:Subcategory gnome:glib
Keywords
Responsible Engineer Chris Wang
Reported Against
Duplicate Of
Introduced In
Commit to Fix vermillion_107
Fixed In vermillion_107
Release Fixed vermillion(vermillion_107)
Related Bugs 6312900
Submit Date 11-December-2008
Last Update Date 21-January-2009
Description
We have added support of  setting the visibility attribute (which is "__attribute__((visibility("hidden")) by using the G_GNUC_INTERNAL macro in SS12, but this macro must be placed before the function declaration, while GCC also support the case when putting the macro after the function declaration.

For instance, in the current gimp code
/*  internal API  */

void  _gimp_help_progress_start  (GimpHelpProgress   *progress,
                                 GCancellable       *cancellable,
                                 const gchar        *format,
                                 ...) G_GNUC_PRINTF (3, 4)       G_GNUC_INTERNAL;
void  _gimp_help_progress_update (GimpHelpProgress   *progress,
                                 gdouble             percentage) G_GNUC_INTERNAL;
void  _gimp_help_progress_pulse  (GimpHelpProgress   *progress)   G_GNUC_INTERNAL;
void  _gimp_help_progress_finish (GimpHelpProgress   *progress)   G_GNUC_INTERNAL;

and when I compile it with SS12, it reports

pkgbuild: /ws/onnv-tools-prc/SUNWspro/SS12/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/include -DDATADIR=\""/usr/share/gimp/2.0"\" -I/usr/sfw/include -DGIMP_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE  -i -xO4 -xspace -xstrconst -xpentium -mr -xregs=no%frameptr  -I/usr/include -KPIC       -c gimphelplocale.c
pkgbuild: "gimphelpprogress-private.h", line 33: warning: useless declaration
pkgbuild: "gimphelpprogress-private.h", line 35: parameter not in identifier list: _gimp_help_progress_update
pkgbuild: "gimphelpprogress-private.h", line 35: syntax error before or at: __hidden
pkgbuild: "gimphelpprogress-private.h", line 35: warning: no explicit type given
pkgbuild: "gimphelpprogress-private.h", line 35: warning: useless declaration
pkgbuild: "gimphelpprogress-private.h", line 36: parameter redeclared: _gimp_help_progress_pulse
pkgbuild: "gimphelpprogress-private.h", line 36: warning: useless declaration
pkgbuild: "gimphelpprogress-private.h", line 37: parameter redeclared: _gimp_help_progress_finish
pkgbuild: "gimphelpprogress-private.h", line 37: syntax error before or at: __hidden
pkgbuild: "gimphelpprogress-private.h", line 37: warning: no explicit type given 


We (desktop team) have to hold many internal patch to move the position of this macro, and we think this could be better if the compiler team may consider to add the support for this.
Work Around
N/A
Comments
N/A