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 725349 - --enable-compile-warnings configure option does nothing
--enable-compile-warnings configure option does nothing
Status: RESOLVED NOTABUG
Product: Gnumeric
Classification: Applications
Component: Compilation
git master
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2014-02-27 21:06 UTC by Pacho Ramos
Modified: 2014-03-01 07:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pacho Ramos 2014-02-27 21:06:40 UTC
It's always appending various flags like -Werror even when I run --enable-compile-warnings=minimum or "no":
config.status: executing po-functions/Makefile commands
config.status: executing po/stamp-it commands
config.status: executing po-functions/stamp-it commands


Configuration:

	Source code location:	.
	Compiler:		gcc
	Compiler flags:		-g -O2   -Wsign-compare -Wpointer-arith -Wchar-subscripts -Wwrite-strings -Wdeclaration-after-statement -Wnested-externs -Wmissing-noreturn -Werror=missing-prototypes -Werror=nested-externs -Werror=implicit-function-declaration -Wmissing-declarations -Wno-pointer-sign -Werror=format-security -Wstrict-prototypes
	Floating point type:	double

	UI:			Gtk

	Perl Support:		yes (using perl)
	Python Support:		yes (using python)

	GDA support:		NO.  libgda problem
	GNOME-DB support:	no
	Psiconv support:        missing dependencies

	PDF documentation:	No, not requested.

Thanks
Comment 1 Morten Welinder 2014-02-27 22:44:28 UTC
I am inclined to call this WONTFIX.

Why do you want this?

We have added, for example,
   -Werror=missing-prototypes
to save us from getting and spending a lot of time on mysterious bug reports
that is the likely result of ignoring such a problem.
Comment 2 Pacho Ramos 2014-02-28 22:03:19 UTC
But the configure switch looks to not work as expected, --enable-compile-warnings=no and minimal ends passing the same flags, not what configure seems to suggest:
    case "$enable_compile_warnings" in
    no)
        warning_flags=
        ;;
    minimum)
        warning_flags="-Wall"
        ;;
    yes)
        warning_flags="$base_warn_flags $base_error_flags"
        ;;
    maximum|error)
        warning_flags="$base_warn_flags $base_error_flags"
        ;;
    *)
        as_fn_error $? "Unknown argument '$enable_compile_warnings' to --enable-compile-warnings" "$LINENO" 5
        ;;
    esac

    if test "$enable_compile_warnings" = "error" ; then
        warning_flags="$warning_flags -Werror"
    fi

With "minimal" I would expect it to only append -Wall... but looks to not work as intended :/
Comment 3 Morten Welinder 2014-02-28 22:44:37 UTC
You're looking in the wrong place.  See configure.ac near line 261.
We add warnings beyond the set controlled by $enable_compile_warnings
It still boils down to this:

> Why do you want this?
Comment 4 Pacho Ramos 2014-02-28 23:14:34 UTC
Well, the idea is to prevent problems like this:
https://bugs.gentoo.org/show_bug.cgi?id=502178

That arise from time to time when, for example, people updates their gcc and, suddenly, the package that was compiling ok before, breaks now due -Werror usage. 

Also, probably https://bugs.gentoo.org/attachment.cgi?id=371096 will interest you :), but the problem I was trying to handle was the future breakages that could occur again in the future due -Werror usage :/
Comment 5 Morten Welinder 2014-03-01 00:00:38 UTC
In this case you hit a macro not being defined.  Had you removed the
error flags you would have been able to compile, but not link.  So in
this case you wouldn't have benefited from avoid Werror.

But let's assume this had been about a function.  Without the Werror, you
could compile and also link.  In most cases, however, they wouldn't work.
Your package would compile, but I'm left with obscure errors happening
only on a users machine.  That's a nightmare to debug.

I really don't want to make it easy to end up in that situation; it's an
utter waste of everyone's time.  I like having the failure obvious like
here, but if you really don't like it, patch configure.ac and set
set_more_warnings to "no" instead.

Note, that the Werror usage here is very targeted to this situation
(as well as -Werror=format-security).  We do not add it for things that
do not matter.  As you discovered here, there is a bug that must be fixed.

As for the patch, I'll commit it.  It means that you are not up to date
with your libgsf, though.
Comment 6 Pacho Ramos 2014-03-01 07:28:38 UTC
In that case no problem. Thanks a lot for the explanation and sorry for the noise.

Regarding the real bug, not sure if I should open a new bug report forwarding that patch (well, you are aware of it already, then, I guess it's not needed). About libgsf version... maybe the user is running an old one, we are only requiring >=gnome-extra/libgsf-1.14.24 as it's the minimal version per configure, but we can raise it too of course

Best regards :)
Comment 7 Pacho Ramos 2014-03-01 07:38:41 UTC
Just seen your message in downstream report. All done then ;)