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 352271 - Location of G_GNUC_INTERNAL breaks Solaris build
Location of G_GNUC_INTERNAL breaks Solaris build
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: general
2.15.x
Other Solaris
: Normal normal
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-21 17:05 UTC by Damien Carbery
Modified: 2010-01-24 01:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Move G_GNUC_INTERNAL to the start of the line. (3.63 KB, patch)
2006-08-21 17:06 UTC, Damien Carbery
committed Details | Review

Description Damien Carbery 2006-08-21 17:05:22 UTC
gimp makes uses of the G_GNUC_INTERNAL macro.
For the Solaris forte compiler this must be placed at the start of the line.

Can you please apply the attached patch - it moves the macro 16 times.
This will not affect gcc - it does not care where the macro is placed.

See also 350606 (gtk-engines) and 352981 (glib).
350606 has a link to a cairo change where they resolved this issue with a
private macro.
Comment 1 Damien Carbery 2006-08-21 17:06:06 UTC
Created attachment 71322 [details] [review]
Move G_GNUC_INTERNAL to the start of the line.
Comment 2 Danielle Madeley 2006-08-21 17:15:14 UTC
Go, go, Solaris magic.
Comment 3 Benoît Dejean 2006-08-21 17:25:02 UTC
solaris forte compiler is not gnu. our G_GNUC_* usage is OK, glib has to be fixed so that this macro are expanded to nothing with solaris forte. i'm against this commit.
Comment 4 Danielle Madeley 2006-08-21 17:27:04 UTC
If we can move a macro and enable it to work with more compilers, I don't see what the problem is. Regardless of where they come from.

Obviously we would never want to break gcc, but anything else we can have is a bonus.
Comment 5 Benoît Dejean 2006-08-21 17:48:10 UTC
Obviously, G_GNUC_ is for GNUC. Glib has to be fixed.
Comment 6 Brian Cameron 2006-08-21 20:03:37 UTC
I've commited this patch, since the patch is marked approved for commit.  GNUC
doesn't care whether the macro is at the beginning or end of the prototype
so this will not break anything and the usage at the beginning of the proto
is more standard (used in Xorg code for example).

I agree that we probably should create new non-GCC macro in the glib code and
use those instead.  Or perhaps doing something like what cairo does and use its
own macros instead of using the problematic Glib ones would be a better approach.

http://gitweb.freedesktop.org/?p=cairo;a=blobdiff;h=9d1c789d2209aab3f969cc1e6baef5a997826e85;hp=447c1ac0bb8fba938495c26abefaecb3e1f87f78;hb=04757a3aa8deeff3265719ebe01b021638990ec6;f=src/cairoint.h

I'm happy to rework the patch so gnome-applets uses its own macro like this
instead if that makes people happier.
Comment 7 Benoît Dejean 2006-08-21 21:02:25 UTC
(In reply to comment #6)
> I've commited this patch, since the patch is marked approved for commit.  GNUC
> doesn't care whether the macro is at the beginning or end of the prototype
> so this will not break anything and the usage at the beginning of the proto
> is more standard (used in Xorg code for example).

i don't get why sun forte cares. Please open a bug against glib.
Comment 8 Ronald Bultje 2006-08-21 21:09:29 UTC
Benoit: it is not the _macro_, but the _location_ of the macro which is the problem. Please check the patch closely. It changes the _location_ of the macro. There is nothing wrong with the patch. G_GNUC_* is indeed for gcc extensions, however, this does not prevent other compilers from implementing similar behaviour using compatible indicators.

The glib documentation could probably be changed to indicate that the macro should be used in the beginning, not at the end, of functions. However, the above patch is still valid.
Comment 9 Brian Cameron 2006-08-21 21:24:58 UTC
Refer here for glib bug on this issue:

http://bugzilla.gnome.org/show_bug.cgi?id=342981

Note bug number is wrong in Damien's original comment #1.

Our hope is that if we can get the various modules that use this macro to conform to the "use before the proto" standard, that we can make progress with the above bug.  It seems that the glib maintainers are not eager to change this without
seeing some support from the other modules that this change is a good move.

It's really a minor change and makes the code easier to compile properly on more compilers without needing to patch the code.  Exactly the same reason why the 
Xorg macros are done this way already.
Comment 10 Benoît Dejean 2006-08-21 21:54:18 UTC
OK ... i just disagree on G_GNUC_* being recycled for !gcc. What if my compiler requires the following "void G_GNUC_INTERNAL foo(int)" ? Btw, i guess it would be better to fix all these issues by using gcc 4 visibility command line args and/or provide a list of public symbols (glib does that i think). pragma are a good solution too.

I feel paranoïd but G_GNUC_INTERNAL has a noticeable effect even on program (not only on shared object) : code size reduction. Tagging every symbol as internal seems stupid.
Comment 11 Danielle Madeley 2006-08-22 05:32:44 UTC
A Glib bug should be opened to discuss this matter in further detail, since we can't effect any change here.