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 743029 - Automatically enable g-ir-scanner warnings if configured with --enable-compile-warnings
Automatically enable g-ir-scanner warnings if configured with --enable-compil...
Status: RESOLVED NOTGNOME
Product: gnome-common
Classification: Core
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: Gnome Common Maintainer(s)
Gnome Common Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-16 11:57 UTC by Philip Withnall
Modified: 2015-01-26 15:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2015-01-16 11:57:08 UTC
GNOME_COMPILE_WARNINGS is deprecated, but I think we need some way of hooking the AX_COMPILER_FLAGS --enable-compile-warnings flag to g-ir-scanner as well as the C compiler.

I’m putting this bug here for lack of a better place to put it. It can be moved later if needed.

I’m thinking we need an AC_SUBST([WARN_SCANNERFLAGS]), which sets
 • --warn-all unless --enable-compile-warnings=no; and
 • --warn-error if --enable-compile-warnings=error.

This could be done as a:
 1. modification to AX_COMPILER_FLAGS upstream; or a
 2. modification to GOBJECT_INTROSPECTION_CHECK in GLib;
 3. extension to GNOME_COMPILE_WARNINGS (even though it’s deprecated in bug #729407).

I’m not really sure which is the best approach.

#1 would complicate the argument list of AX_COMPILER_FLAGS further. In that case it might be better to split it up into something like:
    AX_COMPILER_FLAGS(TOOL-NAME, [VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], …, [EXTRA-ERROR-FLAGS])
and have the user call it several times:
    AX_COMPILER_FLAGS([cc],[WARN_CFLAGS])
    AX_COMPILER_FLAGS([ld],[WARN_LDFLAGS])
    AX_COMPILER_FLAGS([g-ir-scanner],[WARN_SCANNERFLAGS])

#2 would be less invasive, but would mean GOBJECT_INTROSPECTION_CHECK has an implicit optional dependency on AX_COMPILER_FLAGS, and the warning flag stuff is no longer contained in AX_COMPILER_FLAGS. It could check the value of $ax_enable_compile_warnings to set its default flags.

#3 would mean un-deprecating GNOME_COMPILE_WARNINGS, which is a bit silly.

I guess I’m in favour of option #2, unless people think that option #1 is the better long-term solution, especially if AX_COMPILER_FLAGS is to gain support for more tools?
Comment 1 David King 2015-01-16 12:23:05 UTC
I do not think that gnome-common should grow any special support for gobject-introspection, and in general I think that there should be fewer interdependencies between these macros, not more.
Comment 2 Philip Withnall 2015-01-19 19:42:45 UTC
(In reply to comment #1)
> I do not think that gnome-common should grow any special support for
> gobject-introspection,

That rules out option #3, which is good.

> in general I think that there should be fewer
> interdependencies between these macros, not more.

I disagree. As long as the inter-dependencies are soft and not hard, I think it’s generally a good thing. In this case, the benefit comes from everything being keyed off --enable-compiler-warnings, so developers and CI systems only have to set that one option to express what level of checking they want.

I guess it could be compared to every macro having optional support for libtool. A soft dependency.
Comment 3 David King 2015-01-26 15:30:56 UTC
Philip took this to the autoconf archive: https://github.com/pwithnall/autoconf-archive/commit/a2932f4e4eeec1874b8072364774ab7d0015ba90