Skip to content

error: cannot combine with previous 'type-name' declaration specifier gboolean bool #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Schamschula opened this issue Apr 28, 2022 · 16 comments

Comments

@Schamschula
Copy link

While building nip2 under FreeBSD14.0-CURRENT, I get the following error

gmake[5]: Entering directory '/usr/ports/graphics/nip2/work/nip2-8.7.1/src'
cc -DHAVE_CONFIG_H -I. -I..  -I/usr/local/include   -I/usr/local/include/graphviz     -I/usr/local/include/libgsf-1 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/libxml2    -I/usr/local/include  -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include/libpng16 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -I/usr/local/include/libxml2 -I/usr/local/include/libgsf-1 -I/usr/local/include/ImageMagick-7 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/include/orc-0.4 -I/usr/local/include/OpenEXR -I/usr/local/include/Imath -I/usr/local/include/openjpeg-2.4 -I/usr/local/include/libvmaf -DHWY_SHARED_DEFINE -I/usr/local/include/rav1e -I/usr/local/include/poppler/glib -I/usr/local/include/poppler -I/usr/local/include/librsvg-2.0 -D_THREAD_SAFE -pthread   -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS     -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -MT nip2-vipsobject.o -MD -MP -MF .deps/nip2-vipsobject.Tpo -c -o nip2-vipsobject.o `test -f 'vipsobject.c' || echo './'`vipsobject.c
In file included from vipsobject.c:30:
In file included from ./ip.h:129:
In file included from /usr/local/include/gtk-2.0/gtk/gtk.h:33:
In file included from /usr/local/include/gtk-2.0/gtk/gtkaboutdialog.h:32:
In file included from /usr/local/include/gtk-2.0/gtk/gtkdialog.h:35:
In file included from /usr/local/include/gtk-2.0/gtk/gtkwindow.h:36:
In file included from /usr/local/include/gtk-2.0/gtk/gtkbin.h:35:
In file included from /usr/local/include/gtk-2.0/gtk/gtkcontainer.h:35:
In file included from /usr/local/include/gtk-2.0/gtk/gtkwidget.h:36:
In file included from /usr/local/include/gtk-2.0/gtk/gtkobject.h:37:
/usr/local/include/gtk-2.0/gtk/gtktypeutils.h:236:34: warning: 'GTypeDebugFlags' is deprecated [-Wdeprecated-declarations]
void            gtk_type_init   (GTypeDebugFlags    debug_flags);
                                 ^
/usr/local/include/glib-2.0/gobject/gtype.h:704:19: note: 'GTypeDebugFlags' has been explicitly marked deprecated here
} GTypeDebugFlags GLIB_DEPRECATED_TYPE_IN_2_36;
                  ^
/usr/local/include/glib-2.0/glib/gversionmacros.h:548:49: note: expanded from macro 'GLIB_DEPRECATED_TYPE_IN_2_36'
# define GLIB_DEPRECATED_TYPE_IN_2_36           GLIB_DEPRECATED_TYPE
                                                ^
/usr/local/include/glib-2.0/glib/gmacros.h:1179:30: note: expanded from macro 'GLIB_DEPRECATED_TYPE'
#define GLIB_DEPRECATED_TYPE G_DEPRECATED
                             ^
/usr/local/include/glib-2.0/glib/gmacros.h:1102:37: note: expanded from macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
                                    ^
In file included from vipsobject.c:30:
In file included from ./ip.h:129:
In file included from /usr/local/include/gtk-2.0/gtk/gtk.h:126:
In file included from /usr/local/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30:
In file included from /usr/local/include/gtk-2.0/gtk/gtktoolbutton.h:30:
In file included from /usr/local/include/gtk-2.0/gtk/gtktoolitem.h:31:
/usr/local/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: 'GTimeVal' is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations]
  GTimeVal last_popdown;
  ^
/usr/local/include/glib-2.0/glib/gtypes.h:545:35: note: 'GTimeVal' has been explicitly marked deprecated here
typedef struct _GTimeVal GTimeVal GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
                                  ^
/usr/local/include/glib-2.0/glib/gversionmacros.h:961:49: note: expanded from macro 'GLIB_DEPRECATED_TYPE_IN_2_62_FOR'
# define GLIB_DEPRECATED_TYPE_IN_2_62_FOR(f)    GLIB_DEPRECATED_TYPE_FOR(f)
                                                ^
/usr/local/include/glib-2.0/glib/gmacros.h:1180:37: note: expanded from macro 'GLIB_DEPRECATED_TYPE_FOR'
#define GLIB_DEPRECATED_TYPE_FOR(f) G_DEPRECATED_FOR(f)
                                    ^
/usr/local/include/glib-2.0/glib/gmacros.h:1112:44: note: expanded from macro 'G_DEPRECATED_FOR'
#define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
                                           ^
In file included from vipsobject.c:30:
In file included from ./ip.h:372:
./tree.h:129:12: error: cannot combine with previous 'type-name' declaration specifier
                gboolean bool;
                         ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from vipsobject.c:30:
In file included from ./ip.h:372:
./tree.h:129:3: warning: declaration does not declare anything [-Wmissing-declarations]
                gboolean bool;
                ^~~~~~~~~~~~~
3 warnings and 1 error generated.
gmake[5]: *** [Makefile:955: nip2-vipsobject.o] Error 1
@Schamschula
Copy link
Author

Schamschula commented Dec 23, 2022

I see the same error under macOS (Monterey and Ventura) under MacPorts. But this time the error is for

:info:build In file included from plotmodel.c:34:
:info:build In file included from ./ip.h:372:
:info:build ./tree.h:129:12: error: cannot combine with previous 'type-name' declaration specifier
:info:build gboolean bool;
:info:build ^

@Schamschula
Copy link
Author

Any news on this?

@jcupitt
Copy link
Member

jcupitt commented Feb 15, 2023

Hi @Schamschula,

Sorry for not having replied before.

It looks like you are trying to build in C99 mode. This revision of the standard added a built in "bool" type, which will clash with the various boolean types in nip2, libjpeg, etc etc.

Try building in C89 mode.

@jcupitt
Copy link
Member

jcupitt commented Feb 15, 2023

I'll have a quick go at fixing C99 build, perhaps it's a simple thing.

jcupitt added a commit that referenced this issue Feb 15, 2023
@jcupitt
Copy link
Member

jcupitt commented Feb 15, 2023

Ah it was very simple. It now builds for me with:

CFLAGS="-g -Wall --std=c99" ./autogen.sh --prefix=/home/john/vips

Thanks for reporting this dumbness.

@jcupitt jcupitt closed this as completed Feb 15, 2023
@Schamschula
Copy link
Author

Hi @Schamschula,

Sorry for not having replied before.

It looks like you are trying to build in C99 mode. This revision of the standard added a built in "bool" type, which will clash with the various boolean types in nip2, libjpeg, etc etc.

Try building in C89 mode.

I tried setting compiler.c_standard 1989 but ended up with the same errors.

@jcupitt
Copy link
Member

jcupitt commented Feb 15, 2023

Huh that's strange. I tried with clang 15 and with gcc 12 and they both worked. Which compiler are you using?

@jcupitt jcupitt reopened this Feb 15, 2023
@Schamschula
Copy link
Author

On the Mac, I was building using the default Xcode 14.2 compiler clang under macOS Monterey (I get the same error on an Intel iMac running Ventura - same clang version but for x86_64):

% clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.6.0
Thread model: posix

All MacPorts builds have failed for which we have CI records in GitHub (back to 2020).
See: https://github.com/macports/macports-ports/commits/e1ba05f2f68cb2aa788e7b096e401b394101a73d/graphics/nip2/Portfile

@jcupitt
Copy link
Member

jcupitt commented Feb 16, 2023

That's strange, I wonder why it fails.

Could you (very quickly! I'd hate to waste your time!) try git master head for nip2? If that patch fixes it, I'll make a new release.

(my 2012 imac finally died last week or I'd test myself)

@Schamschula
Copy link
Author

The patch file fails when applied to 8.7.1. I tried building from master and got the following error while running ./configure after running autoreconf to build configure, etc.:

config.status: error: cannot find input file: `po/Makefile.in.in'
Command failed: cd "/opt/local/var/macports/build/_Users_marius_Development_MacPorts_ports_graphics_nip2/nip2/work/nip2-8.9.1" && ./configure --prefix=/opt/local --disable-update-desktop
Exit code: 1

@jcupitt
Copy link
Member

jcupitt commented Feb 16, 2023

I tried making a test release:

http://www.rollthepotato.net/~john/nip2-8.9.1.tar.gz

That ought to build (hopefully) with just ./configure --prefix=xxx && make && make install.

@Schamschula
Copy link
Author

The test release results in a clean build!

@jcupitt
Copy link
Member

jcupitt commented Feb 16, 2023

Great! I'll make a proper release. Thanks for pushing on this issue @Schamschula.

@Schamschula
Copy link
Author

P.S. That build was using the MacPorts infrastructure.

When I opened the App, the first thing I noticed is that the Copyright date needs to be updated before the official release.

@jcupitt
Copy link
Member

jcupitt commented Feb 16, 2023

OK, we have https://github.com/libvips/nip2/releases/tag/v8.9.1

I updated the copyright too.

@jcupitt jcupitt closed this as completed Feb 16, 2023
Schamschula added a commit to macports/macports-ports that referenced this issue Feb 16, 2023
@Schamschula
Copy link
Author

Pushed update to MacPorts: macports/macports-ports@52ab6fd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants