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 658608 - Add GNOME_STRICT macro
Add GNOME_STRICT macro
Status: RESOLVED OBSOLETE
Product: gnome-common
Classification: Core
Component: general
git master
Other All
: High critical
: ---
Assigned To: Gnome Common Maintainer(s)
Gnome Common Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-09-08 22:09 UTC by Allison Karlitskaya (desrt)
Modified: 2011-12-26 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GNOME_STRICT macro (2.45 KB, patch)
2011-09-08 22:09 UTC, Allison Karlitskaya (desrt)
none Details | Review

Description Allison Karlitskaya (desrt) 2011-09-08 22:09:23 UTC
This will help to sort out a bit of the AM_MAINTAINER_MODE mess we currently have.
Comment 1 Allison Karlitskaya (desrt) 2011-09-08 22:09:40 UTC
Created attachment 196042 [details] [review]
Add GNOME_STRICT macro

Add a new GNOME_STRICT macro.  When this appears in configure.ac, a new
argument --enable-strict is added and a STRICT_FLAGS substitution is
defined.

By default, STRICT_FLAGS is empty.  Using --enable-strict causes
STRICT_FLAGS to be set to contain -Werror as well as
-DG_DISABLE_DEPRECATED and equivalent flags for most commonly-used
libraries in the GNOME platform.

The idea is that maintainers can use --enable-strict to check their
modules for correctness, but casual builders of the module (from
tarball, jhbuild or otherwise) will not be harmed.

At the same time, deprecate GNOME_MAINTAINER_MODE_DEFINES and define it
in terms of the new GNOME_STRICT.
Comment 2 Javier Jardón (IRC: jjardon) 2011-09-09 00:57:19 UTC
I already discussed this in the release team mailing list [1] after ask in the autoconf mailing list [2]. This is the propossed code:

dnl ---------------------------------------------------------------------------
dnl - Use strict options (default enabled for devs, disabled in releases)
dnl ---------------------------------------------------------------------------
dnl if .git directory is present, considering we are working in the repository

test -d "$(srcdir)/.git"; then
        default_strict=yes
else
        default_strict=no
fi

AC_ARG_ENABLE([strict],
              [AS_HELP_STRING([--enable-strict],
                              [Enable strict compilation options])],
              [enable_strict=$enableval],
              [enable_strict=$default_strict])

if test x$enable_strict != xno; then
    CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
fi



There is already a discussion to add a macro like this in bug #614360 and a suggestion to include it in Glib in bug #635328

[1] https://mail.gnome.org/archives/release-team/2011-June/msg00030.html
[2] http://lists.gnu.org/archive/html/autoconf/2011-06/msg00026.html
Comment 3 Allison Karlitskaya (desrt) 2011-09-09 02:28:36 UTC
I don't like the check for .git because it will hit casual users of jhbuild.
Comment 4 Vincent Untz 2011-09-09 06:40:05 UTC
Combining -Werror with the deprecated flags will be a nightmare, we don't want that, really :-) (Else, it's just not possible to port step by step an app using deprecated API).

Also, --enable-strict is a nice name, but it's probably way too generic without a namespace. So --enable-gnome-strict, maybe?
Comment 5 Milan Bouchet-Valat 2011-09-09 13:17:26 UTC
And what about --gnome-disable-deprecated, if you remove -Werror?
Comment 6 Javier Jardón (IRC: jjardon) 2011-09-14 12:28:13 UTC
Also, I'd introduce this macro in Glib instead gnome-common, as Its useful not only for GNOME projects.
Comment 7 Allison Karlitskaya (desrt) 2011-09-14 12:52:31 UTC
I think we would not accept this macro in GLib for a few reasons.

First, it's a bit of a mess to have a list of random GNOME packages in GLib.  Some pkg-config based solution would really be better here.

Second, we have an intention to move away from macro-based deprecations in GLib toward GCC-attribute-based deprecations, so this is all a bit out of tune with that anyway.
Comment 8 Javier Jardón (IRC: jjardon) 2011-12-26 14:35:46 UTC
Marking as OBSOLETE as we have now deprecation warnings when compiling in Glib/GTK+/GObject libraries