glib/gobject
Kouhei Sutou b8ac6e146a Suppress -Wint-in-bool-context warning with G_DEFINE_INTERFACE and g++
Note that it's not reported with gcc. It's only reported with g++.

C++ code to reproduce this warning:

    #include <glib-object.h>

    G_BEGIN_DECLS

    #define GARROW_TYPE_FILE (garrow_file_get_type())
    G_DECLARE_INTERFACE(GArrowFile,
                        garrow_file,
                        GARROW,
                        FILE,
                        GObject)

    struct _GArrowFileInterface {
      GTypeInterface g_iface;
    };

    G_DEFINE_INTERFACE(GArrowFile,
                       garrow_file,
                       G_TYPE_OBJECT)

    static void
    garrow_file_default_init(GArrowFileInterface *iface)
    {
    }

    G_END_DECLS

Build command line:

    % g++ -Wall -shared -o liba.so a.cpp $(pkg-config --cflags --libs gobject-2.0)

Message:

    In file included from /tmp/local.glib/include/glib-2.0/gobject/gobject.h:24,
                     from /tmp/local.glib/include/glib-2.0/gobject/gbinding.h:29,
                     from /tmp/local.glib/include/glib-2.0/glib-object.h:23,
                     from a.cpp:1:
    a.cpp: In function 'GType garrow_file_get_type()':
    /tmp/local.glib/include/glib-2.0/gobject/gtype.h:219:50: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
     #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT))
                                                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /tmp/local.glib/include/glib-2.0/gobject/gtype.h:2026:11: note: in definition of macro '_G_DEFINE_INTERFACE_EXTENDED_BEGIN'
           if (TYPE_PREREQ) \
               ^~~~~~~~~~~
    /tmp/local.glib/include/glib-2.0/gobject/gtype.h:1758:47: note: in expansion of macro 'G_DEFINE_INTERFACE_WITH_CODE'
     #define G_DEFINE_INTERFACE(TN, t_n, T_P)      G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    a.cpp:16:1: note: in expansion of macro 'G_DEFINE_INTERFACE'
     G_DEFINE_INTERFACE(GArrowFile,
     ^~~~~~~~~~~~~~~~~~
    /tmp/local.glib/include/glib-2.0/gobject/gtype.h:178:25: note: in expansion of macro 'G_TYPE_MAKE_FUNDAMENTAL'
     #define G_TYPE_OBJECT   G_TYPE_MAKE_FUNDAMENTAL (20)
                             ^~~~~~~~~~~~~~~~~~~~~~~
    a.cpp:18:20: note: in expansion of macro 'G_TYPE_OBJECT'
                        G_TYPE_OBJECT)
                        ^~~~~~~~~~~~~
2018-12-20 11:24:53 +09:00
..
tests tests: s/assertEquals/assertEqual/ 2018-12-12 12:57:51 +01:00
.gitignore build: Drop nmake/MSC build system for GLib 2017-07-10 11:22:40 +01:00
gatomicarray.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gatomicarray.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gbinding.c binding: Clarify the use of g_object_unref() to remove a binding 2018-12-17 11:01:07 +01:00
gbinding.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gboxed.c gdate: add g_date_copy() 2017-10-11 12:13:20 +01:00
gboxed.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gclosure.c gclosure: Minor documentation formatting improvements 2018-08-16 10:59:45 +01:00
gclosure.h gclosure: Expand documentation and fix some typos 2018-04-26 18:04:47 +01:00
genums.c gobject/genums.c: fix flags validation 2018-11-01 01:41:32 +03:00
genums.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
glib-genmarshal.in gobject: Fix redundant warning message in glib-genmarshal 2018-04-23 16:16:36 +01:00
glib-mkenums.in glib-mkenums: Support reading @rspfiles for arguments 2018-12-04 16:16:00 +05:30
glib-types.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gmarshal.c introspection: use (nullable) or (optional) instead of (allow-none) 2016-11-22 14:14:37 -08:00
gmarshal.h gmarshal.h: replace "extern" with GLIB_AVAILABLE_IN_ALL 2013-01-13 13:13:55 -05:00
gobject_gdb.py python: avoid equality check for None 2018-07-12 23:48:41 +02:00
gobject_probes.d Add missing semicolons to gobject_probes.d 2012-10-15 19:48:44 -04:00
gobject_trace.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gobject-autocleanups.h gobject: Add g_autoptr() support for GTypeClass, GEnumClass, GFlagsClass 2018-05-15 15:38:33 +01:00
gobject-query.c Spelling: fix spelling of specify 2018-09-25 14:34:48 +01:00
gobject.c gobject: Convert a debug check from an assertion to a g_critical() 2018-10-11 11:40:12 +13:00
gobject.h gmacros: Add new private g_has_typeof to abstract __typeof__ checks 2018-07-16 15:59:44 +01:00
gobject.rc.in meson: build Windows resource files 2018-01-04 22:19:30 +01:00
gobject.stp.in glib: Namespace global tapset variables by soname 2016-11-23 10:50:39 +00:00
gobjectnotifyqueue.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gparam.c gobject: Fix typo in documentation for g_param_spec_get_default_value() 2017-11-01 11:13:27 +00:00
gparam.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gparamspecs.c gobject: Reimplement g_param_values_cmp() for GParamSpecVariant 2018-05-04 18:17:59 +01:00
gparamspecs.h gobject: Reimplement g_param_values_cmp() for GParamSpecVariant 2018-05-04 18:17:59 +01:00
gsignal.c docs: Fix typo in gsignal.c documentation comment 2018-05-17 13:54:46 +01:00
gsignal.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gsourceclosure.c all: Remove trailing newlines from g_message()/g_warning()/g_error()s 2018-04-27 16:46:19 +01:00
gsourceclosure.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gtype-private.h gtype: Add private DEFINE_TYPE with prelude to workaround gtype deadlocks 2017-06-14 14:45:45 -04:00
gtype.c Deprecate g_type_class_add_private() 2018-06-14 11:33:53 +01:00
gtype.h Suppress -Wint-in-bool-context warning with G_DEFINE_INTERFACE and g++ 2018-12-20 11:24:53 +09:00
gtypemodule.c all: Remove trailing newlines from g_message()/g_warning()/g_error()s 2018-04-27 16:46:19 +01:00
gtypemodule.h docs: Remove XML-style comments from documentation strings 2018-01-12 15:29:29 +00:00
gtypeplugin.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gtypeplugin.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvalue.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvalue.h Revert "GValue – Don't cast G_VALUE_TYPE() argument to GValue*" 2018-02-08 14:28:32 +00:00
gvaluearray.c build: Remove the --disable-mem-pools build option and the DISABLE_MEM_POOLS macro 2018-06-02 09:45:55 +02:00
gvaluearray.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvaluecollector.h gobject: Add prefixes to variables in G_VALUE_COLLECT*() macros 2018-06-20 16:00:48 +01:00
gvaluetransform.c gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gvaluetypes.c g_value_get_variant: return value is transfer-none not transfer-full 2018-11-25 13:05:54 +01:00
gvaluetypes.h gobject/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
libgobject-gdb.py.in Rename gdb macros with _gdb suffix to avoid ns clashes 2016-05-23 10:52:10 -04:00
Makefile.am build-sys: Pass CFLAGS to $(DTRACE) 2018-10-15 21:50:31 +00:00
meson.build Merge branch 'meson-dep' into 'master' 2018-12-10 22:39:32 +00:00