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 781070 - enum collisions w/o -DGIMP_DISABLE_DEPRECATED
enum collisions w/o -DGIMP_DISABLE_DEPRECATED
Status: RESOLVED NOTABUG
Product: GIMP
Classification: Other
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2017-04-08 22:38 UTC by Sebastian Pipping
Modified: 2017-04-10 08:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Pipping 2017-04-08 22:38:24 UTC
Hi!


I would like to let you know that we patch away *_DISABLE_DEPRECATED defines from configure scripts for GNOME applications by general in Gentoo, which includes GIMP_DISABLE_DEPRECATED.  It came to my attention [1] that without -DGIMP_DISABLE_DEPRECATED Gimp Git master no longer compiles because gimpcompatenums.h and gimpbasetypes.h define a number of enum values twice.  While in different enum types, they are in the global C namespace technically which is why they collide, e.g.:


In file included from gimpbase-private.c:29:0:
gimpcompatenums.h:36:3: error: redeclaration of enumerator ‘GIMP_ADD_WHITE_MASK’
   GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,
   ^
In file included from gimpbasetypes.h:26:0,
                 from gimpbase-private.c:26:
../libgimpbase/gimpbaseenums.h:52:3: note: previous definition of ‘GIMP_ADD_WHITE_MASK’ was here
   GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,     /*< skip, pdb-skip >*/
   ^


For me, patch [2] fixes compilation.  Are you aware of the collisions?  Are there plans to resolve them?

Best, Sebastian



[1] https://bugs.gentoo.org/show_bug.cgi?id=614914
[2] https://614914.bugs.gentoo.org/attachment.cgi?id=469518
Comment 1 Michael Natterer 2017-04-09 16:27:44 UTC
If gentoo patches GIMP, and as a consequence GIMP breaks, that's
exactly gentoo's problem.
Comment 2 Sebastian Pipping 2017-04-09 16:30:57 UTC
True.

What is the current purpose of the GIMP_DISABLE_DEPRECATED switch if it's not fully functional?
Comment 3 Michael Natterer 2017-04-09 16:39:58 UTC
If is fully functional, for building external plug-ins, you can
to that both with and without GIMP_DISABLE_DEPRECATED defined.

GIMP itself can however only be built with the define, it's not
supposed to be configurable, and there is no reasaon not to have
it defined.
Comment 4 Sebastian Pipping 2017-04-09 17:46:16 UTC
(In reply to Michael Natterer from comment #3)
> If is fully functional, for building external plug-ins, you can
> to that both with and without GIMP_DISABLE_DEPRECATED defined.

So a plugin could never include both gimpcompatenums.h and gimpbasetypes.h and not define GIMP_DISABLE_DEPRECATED?


> GIMP itself can however only be built with the define, it's not
> supposed to be configurable, and there is no reasaon not to have
> it defined.

Good to know.  I'll need to whitelist GIMP_DISABLE_DEPRECATED, then.
( https://github.com/gentoo/gentoo/blob/master/eclass/gnome2-utils.eclass#L494 )
Comment 5 Michael Natterer 2017-04-09 18:08:13 UTC
A plug-in can never include gimpcompatenums.h, it's not even installed.
Comment 6 Sebastian Pipping 2017-04-09 18:09:50 UTC
Alright, thanks.