Project

General

Profile

Bug #24771

2.6.0 build fails if --enable-debugging is passed to configure script

Added by John Dennis almost 5 years ago. Updated over 3 years ago.

Status:
Fermé
Priority:
Normal
Category:
-
Target version:
Start date:
25 June 2018
Due date:
% Done:

100%

Estimated time:
Patch proposed:
Yes
Planning:
No

Description

On line 703 of configure.ac -Werror is added to CFLAGS if enable-debugging is on.

-Werror causes the compilation to fail if any warnings are emitted during compilation.

However lasso version 2.6.0 when built with gcc 8.1.1 has numerous compiler warnings, both in the core and in the bindings. Thus with --enable-debugging the build fails almost immediately (as soon as a warning is emitted). This prevents lasso from being built with debugging support.


Files

Associated revisions

Revision 62d2f4bf (diff)
Added by Benjamin Dauvergne almost 5 years ago

Move AC_SUBST declaration for AM_CFLAGS with alike (#24771)

Just to reorder things properly in configure.ac.

Revision 50b5cdac (diff)
Added by Benjamin Dauvergne almost 5 years ago

Remove -Werror from --enable-debugging (fixes #24771)

GCC 8 has better warnings and it breaks the build on platform already
using it and wanting debugging symbols.

History

#1

Updated by Benjamin Dauvergne almost 5 years ago

I'm ok to remove it, and create a --pedantic option instead.

#2

Updated by John Dennis almost 5 years ago

Adding --pedantic to enable -Werror sounds like a good approach to me, it separates two concepts (debugging and strictness) that got co-mingled. At some point the warnings should be looked at, I assume since -Werror has been a part of --debugging for a while it implies there was a recent point in time where there were no warnings so it shouldn't be too hard.

On an almost unrelated note, I've got a number patches prepared to support using Python3 during the build. It appears as if although the generated Python binding had been ported to Py3 other build scripts and the automake files were not ready to handle Py3. It was while I was working on getting the Py3 build working that I tried to turn on debugging and discovered it failed. My quick and dirty interim solution was to just temporarily remove -Werror from the CFLAGS and I was able to move on.

#3

Updated by Benjamin Dauvergne almost 5 years ago

  • Target version set to 2.6.1
#4

Updated by Benjamin Dauvergne almost 5 years ago

  • Assignee set to John Dennis
#5

Updated by Benjamin Dauvergne almost 5 years ago

  • Assignee changed from John Dennis to Benjamin Dauvergne
#8

Updated by Benjamin Dauvergne almost 5 years ago

  • Status changed from Solution proposée to Résolu (à déployer)
  • % Done changed from 0 to 100
#9

Updated by John Dennis almost 5 years ago

Hi Benjamin:

I think there are a couple of issues with the patch or perhaps I'm not in sync with what you were trying to achieve, so here's my questions:

Why is there any connection between debugging and the pedantic option? The two seem independent to me. In one case I want to produce a build I can run under the debugger and in the other case I want to see if the compiler can help me diagnose coding mistakes. I don't see any correlation between the two.

There was already an enable pedantic option and now it looks like you're processing that arg twice.

if test "z$enable_pedantic" = "zyes" ; then
enable_pedantic=yes

Isn't the assignment of 'yes' to enable_pedantic a redundant no-op here? The assignment is inside a conditional block that has confirmed that enable_pedantic is already 'yes'.

+ if test "z$enable_debugging" "!=" "zyes" ; then
+ LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG"
+ CFLAGS="$CFLAGS -O0 -g -Wall -Wextra"
+ fi

This seems to enforce the requirement that if you enable pedantic you must compile with the option to produce a debuggable build. Is this something gcc requires? If not why are we enforcing this?

I'm not even sure -Wall and -Wextra should be turned on by saying I want a build that I can run under gdb, but I'm OK with it, I can see the value in it but on the other hand I prefer options that do not have unrelated side-effects.

#10

Updated by Benjamin Dauvergne almost 5 years ago

John Dennis a écrit :

Hi Benjamin:

I think there are a couple of issues with the patch or perhaps I'm not in sync with what you were trying to achieve, so here's my questions:

Why is there any connection between debugging and the pedantic option? The two seem independent to me. In one case I want to produce a build I can run under the debugger and in the other case I want to see if the compiler can help me diagnose coding mistakes. I don't see any correlation between the two.

There was already an enable pedantic option and now it looks like you're processing that arg twice.

if test "z$enable_pedantic" = "zyes" ; then
enable_pedantic=yes

Isn't the assignment of 'yes' to enable_pedantic a redundant no-op here? The assignment is inside a conditional block that has confirmed that enable_pedantic is already 'yes'.

+ if test "z$enable_debugging" "!=" "zyes" ; then
+ LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG"
+ CFLAGS="$CFLAGS -O0 -g -Wall -Wextra"
+ fi

This seems to enforce the requirement that if you enable pedantic you must compile with the option to produce a debuggable build. Is this something gcc requires? If not why are we enforcing this?

I'm not even sure -Wall and -Wextra should be turned on by saying I want a build that I can run under gdb, but I'm OK with it, I can see the value in it but on the other hand I prefer options that do not have unrelated side-effects.

Finally I choosed to simply remove -Werror from the debugging CFLAGS, so all is well.

#11

Updated by Benjamin Dauvergne over 3 years ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF