Quantcast

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

Helmut Jarausch
Hi, I cannot compile the GIT version (today 16:00 GMT)
Both, gimpbaseenums.h  and gimpcompatenums.h define several enums of  
the same name.
This is on Gentoo, gcc-6.3.0

Thanks for looking into it,
Helmut.

Here are a few lines from the error log:

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 >*/
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0:
gimpcompatenums.h:37:3: error: redeclaration of enumerator  
'GIMP_ADD_BLACK_MASK'
    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,
                  from gimpbase-private.c:26:
../libgimpbase/gimpbaseenums.h:53:3: note: previous definition of  
'GIMP_ADD_BLACK_MASK' was here
    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     /*< skip,  
pdb-skip >*/
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0:
gimpcompatenums.h:38:3: error: redeclaration of enumerator  
'GIMP_ADD_ALPHA_MASK'
    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,
                  from gimpbase-private.c:26:
../libgimpbase/gimpbaseenums.h:54:3: note: previous definition of  
'GIMP_ADD_ALPHA_MASK' was here
    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     /*< skip,  
pdb-skip >*/
    ^~~~~~~~~~~~~~~~~~~
In file included from gimpbase-private.c:29:0:
gimpcompatenums.h:39:3: error: redeclaration of enumerator  
'GIMP_ADD_ALPHA_TRANSFER_MASK'
    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gimpbasetypes.h:26:0,
                  from gimpbase-private.c:26:
../libgimpbase/gimpbaseenums.h:55:3: note: previous definition of  
'GIMP_ADD_ALPHA_TRANSFER_MASK' was here
    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /*<  
skip, pdb-skip >*/
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

Michael Natterer
On Thu, 2017-01-12 at 18:14 +0100, Helmut Jarausch wrote:
> Hi, I cannot compile the GIT version (today 16:00 GMT)
> Both, gimpbaseenums.h  and gimpcompatenums.h define several enums
> of  
> the same name.
> This is on Gentoo, gcc-6.3.0

This shouldn't happen, the resp. values in gimpbaseenums.h are
protected by #ifndef GIMP_DISABLE_DEPRECATED and that is always
defined when building GIMP.

Did you somehow undefine it?

Regards,
Mitch


> Thanks for looking into it,
> Helmut.
>
> Here are a few lines from the error log:
>
> 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 >*/
>     ^~~~~~~~~~~~~~~~~~~
> In file included from gimpbase-private.c:29:0:
> gimpcompatenums.h:37:3: error: redeclaration of enumerator  
> 'GIMP_ADD_BLACK_MASK'
>     GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,
>     ^~~~~~~~~~~~~~~~~~~
> In file included from gimpbasetypes.h:26:0,
>                   from gimpbase-private.c:26:
> ../libgimpbase/gimpbaseenums.h:53:3: note: previous definition of  
> 'GIMP_ADD_BLACK_MASK' was here
>     GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     /*<
> skip,  
> pdb-skip >*/
>     ^~~~~~~~~~~~~~~~~~~
> In file included from gimpbase-private.c:29:0:
> gimpcompatenums.h:38:3: error: redeclaration of enumerator  
> 'GIMP_ADD_ALPHA_MASK'
>     GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,
>     ^~~~~~~~~~~~~~~~~~~
> In file included from gimpbasetypes.h:26:0,
>                   from gimpbase-private.c:26:
> ../libgimpbase/gimpbaseenums.h:54:3: note: previous definition of  
> 'GIMP_ADD_ALPHA_MASK' was here
>     GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     /*<
> skip,  
> pdb-skip >*/
>     ^~~~~~~~~~~~~~~~~~~
> In file included from gimpbase-private.c:29:0:
> gimpcompatenums.h:39:3: error: redeclaration of enumerator  
> 'GIMP_ADD_ALPHA_TRANSFER_MASK'
>     GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from gimpbasetypes.h:26:0,
>                   from gimpbase-private.c:26:
> ../libgimpbase/gimpbaseenums.h:55:3: note: previous definition of  
> 'GIMP_ADD_ALPHA_TRANSFER_MASK' was here
>     GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,
> /*<  
> skip, pdb-skip >*/
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _______________________________________________
> gimp-developer-list mailing list
> List address:    [hidden email]
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-develop
> er-list
> List archives:   https://mail.gnome.org/archives/gimp-developer-list
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

Helmut Jarausch
On 01/12/2017 07:01:14 PM, Michael Natterer wrote:

> On Thu, 2017-01-12 at 18:14 +0100, Helmut Jarausch wrote:
> > Hi, I cannot compile the GIT version (today 16:00 GMT)
> > Both, gimpbaseenums.h  and gimpcompatenums.h define several enums
> > of  
> > the same name.
> > This is on Gentoo, gcc-6.3.0
>
> This shouldn't happen, the resp. values in gimpbaseenums.h are
> protected by #ifndef GIMP_DISABLE_DEPRECATED and that is always
> defined when building GIMP.
>
> Did you somehow undefine it?
>
> Regards,
> Mitch

Not intentionally, at least.

File gimpbase-private.c unconditionally includes

gimpbasetypes.h  which includes gimpbaseenums.h
and
gimpcompatenums.h

both, gimpbaseenums.h and gimpcompatenums.h declare uncondtionally

typedef enum
{
   GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,
   GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,
   GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,
   GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,
   GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION,
   GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,
   GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL
} GimpAddMaskTypeCompat;

and
typedef enum
{
   GIMP_ADD_MASK_WHITE,          /*< desc="_White (full  
opacity)"           >*/
   GIMP_ADD_MASK_BLACK,          /*< desc="_Black (full  
transparency)"      >*/
   GIMP_ADD_MASK_ALPHA,          /*< desc="Layer's _alpha  
channel"          >*/
   GIMP_ADD_MASK_ALPHA_TRANSFER, /*< desc="_Transfer layer's alpha  
channel" >*/
   GIMP_ADD_MASK_SELECTION,      /*<  
desc="_Selection"                      >*/
   GIMP_ADD_MASK_COPY,           /*< desc="_Grayscale copy of  
layer"        >*/
   GIMP_ADD_MASK_CHANNEL,        /*<  
desc="C_hannel"                        >*/

#ifndef GIMP_DISABLE_DEPRECATED
   GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,     /*< skip,  
pdb-skip >*/
   GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     /*< skip,  
pdb-skip >*/
   GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     /*< skip,  
pdb-skip >*/
   GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /*<  
skip, pdb-skip >*/
   GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION, /*< skip,  
pdb-skip >*/
   GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,      /*< skip,  
pdb-skip >*/
   GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL    /*< skip,  
pdb-skip >*/
#endif /* GIMP_DISABLE_DEPRECATED */
} GimpAddMaskType;

such that  GIMP_ADD_MASK_WHITE is declared twice, indeed.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

Michael Natterer
On Thu, 2017-01-12 at 20:16 +0100, Helmut Jarausch wrote:

> On 01/12/2017 07:01:14 PM, Michael Natterer wrote:
> > On Thu, 2017-01-12 at 18:14 +0100, Helmut Jarausch wrote:
> > > Hi, I cannot compile the GIT version (today 16:00 GMT)
> > > Both, gimpbaseenums.h  and gimpcompatenums.h define several enums
> > > of  
> > > the same name.
> > > This is on Gentoo, gcc-6.3.0
> >
> > This shouldn't happen, the resp. values in gimpbaseenums.h are
> > protected by #ifndef GIMP_DISABLE_DEPRECATED and that is always
> > defined when building GIMP.
> >
> > Did you somehow undefine it?
> >
> > Regards,
> > Mitch
>
> Not intentionally, at least.
>
> File gimpbase-private.c unconditionally includes
>
> gimpbasetypes.h  which includes gimpbaseenums.h
> and
> gimpcompatenums.h
>
> both, gimpbaseenums.h and gimpcompatenums.h declare uncondtionally
>
> typedef enum
> {
>    GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,
>    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,
>    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,
>    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,
>    GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION,
>    GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,
>    GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL
> } GimpAddMaskTypeCompat;
>
> and
> typedef enum
> {
>    GIMP_ADD_MASK_WHITE,          /*< desc="_White (full  
> opacity)"           >*/
>    GIMP_ADD_MASK_BLACK,          /*< desc="_Black (full  
> transparency)"      >*/
>    GIMP_ADD_MASK_ALPHA,          /*< desc="Layer's _alpha  
> channel"          >*/
>    GIMP_ADD_MASK_ALPHA_TRANSFER, /*< desc="_Transfer layer's alpha  
> channel" >*/
>    GIMP_ADD_MASK_SELECTION,      /*<  
> desc="_Selection"                      >*/
>    GIMP_ADD_MASK_COPY,           /*< desc="_Grayscale copy of  
> layer"        >*/
>    GIMP_ADD_MASK_CHANNEL,        /*<  
> desc="C_hannel"                        >*/
>
> #ifndef GIMP_DISABLE_DEPRECATED
>    GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,     /*<
> skip,  
> pdb-skip >*/
>    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,     /*<
> skip,  
> pdb-skip >*/
>    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,     /*<
> skip,  
> pdb-skip >*/
>    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, /*<  
> skip, pdb-skip >*/
>    GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION, /*<
> skip,  
> pdb-skip >*/
>    GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,      /*<
> skip,  
> pdb-skip >*/
>    GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL    /*<
> skip,  
> pdb-skip >*/
> #endif /* GIMP_DISABLE_DEPRECATED */
> } GimpAddMaskType;
>
> such that  GIMP_ADD_MASK_WHITE is declared twice, indeed.

It's only declared twice if GIMP_DISABLE_DEPRECATED is *not*
defined. Can you paste the output of "make V=1" of
gimpbase-private.c please?

Regards,
Mitch

_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libgimpbase/gimpbaseenums.h and gimpcompatenums.h name collisions

Michael Natterer
In reply to this post by Helmut Jarausch
On Thu, 2017-01-12 at 21:57 +0100, Helmut Jarausch wrote:

> On 01/12/2017 08:58:11 PM, Michael Natterer wrote:
> > It's only declared twice if GIMP_DISABLE_DEPRECATED is *not*
> > defined. Can you paste the output of "make V=1" of
> > gimpbase-private.c please?
> >
> > Regards,
> > Mitch
> >
>
> I've attached the log.
>
> gimpbase-private.c  includes unconditionally
>
>
> #include "config.h"
>
> #include <gio/gio.h>
>
> #include "gimpbasetypes.h"
>
> #include "gimpbase-private.h"
> #include "gimpcompatenums.h"
>
>
> Here the first non-comment lines of gimpbasetypes.h
>
> #ifndef __GIMP_BASE_TYPES_H__
> #define __GIMP_BASE_TYPES_H__
>
>
> #include <libgimpcolor/gimpcolortypes.h>
> #include <libgimpmath/gimpmathtypes.h>
>
> #include <libgimpbase/gimpbaseenums.h>
> #include <libgimpbase/gimpparam.h>
>
> And here the first lines of gimpcompatenums.h
>
> #ifndef __GIMP_COMPAT_ENUMS_H__
> #define __GIMP_COMPAT_ENUMS_H__
>
>
> G_BEGIN_DECLS
>
> /*  These enums exist only for compatibility, their nicks are needed
>   *  for config file parsing; they are registered in
> gimp_base_init().
>   */
>
>
> #define GIMP_TYPE_ADD_MASK_TYPE_COMPAT  
> (gimp_add_mask_type_compat_get_type ())
>
> GType gimp_add_mask_type_compat_get_type (void) G_GNUC_CONST;
>
> typedef enum
> {
>    GIMP_ADD_WHITE_MASK          = GIMP_ADD_MASK_WHITE,
>    GIMP_ADD_BLACK_MASK          = GIMP_ADD_MASK_BLACK,
>    GIMP_ADD_ALPHA_MASK          = GIMP_ADD_MASK_ALPHA,
>    GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER,
>    GIMP_ADD_SELECTION_MASK      = GIMP_ADD_MASK_SELECTION,
>    GIMP_ADD_COPY_MASK           = GIMP_ADD_MASK_COPY,
>    GIMP_ADD_CHANNEL_MASK        = GIMP_ADD_MASK_CHANNEL
> } GimpAddMaskTypeCompat;
>
>
> In bothes cases I don't see any conditional compilation which
> precludes  
> the double definitions.

In gimpbaseenums.h there clearly is #ifndef GIMP_DISABLE_DEPRECATED
that protects GIMP_ADD_WHITE_MASK and the other compat values from
being visible if it's defined.

In your build log there is -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE
which are part of CPPFLAGS as assembled in configure.ac. A few lines
above adding -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE it adds
-DGIMP_DISABLE_DEPRECATED, also unconditionally.

You probably changed your configure.ac, I have no other explanation
how -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE but NOT
-DGIMP_DISABLE_DEPRECATED end up on your compiler command line.

Please have a look at your configure.ac:

CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED
-DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE"

and a few lines below:

CPPFLAGS="${CPPFLAGS} -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"

I have no explanation why the latter but not the former
would make it to your compiler command line.

Please double check your source tree and maybe environment variables.

Regards,
Mitch

_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Loading...