public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "slyfox at inbox dot ru" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/23914] Add --disable-werror to ./configure support (example trigger:  CFLAGS=-Og
Date: Fri, 23 Nov 2018 23:42:00 -0000	[thread overview]
Message-ID: <bug-23914-10460-dYbvqlxqev@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-23914-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=23914

--- Comment #2 from Sergei Trofimovich <slyfox at inbox dot ru> ---
(In reply to Mark Wielaard from comment #1)
> I rather have that people report such issues and we fix them.

Totally understandable. My intent is to only still be able to build old
releases with new toolchains or against exotic yet safe CFLAGS  without resort
to manual patching of build system.

I would suggest having --enable-werror enabled by default. That way we would be
able to disable it downstream for older packages on first offense.

> In this case it really was just that one gcc warning (plus an almost
> identical one in dwarf_getattrs):
> https://sourceware.org/ml/elfutils-devel/2018-q4/msg00174.html
> 
> And that build flag actually showed a very interesting nasty bug that we
> might not have found otherwise:
> https://sourceware.org/ml/elfutils-devel/2018-q4/msg00175.html
> 
> Does Gentoo show any other compile errors?

Yes. I can trigger a lot of them passing various warning flags (I'll post those
below).

Gentoo allows users to control CC and CFLAGS and thus the space for getting a
warning is wide. People frequently use things like -Wcast-qual or other high
signal-to-noise flags for their purposes.

My favourite example is
    ./configure CFLAGS="-g -Wall" # works today without failures
or even ./configure CC=clang CFLAGS="-g -Weverything" but elfutils does not
seem to support clang.

Real-world examples used by people:

1. CFLAGS="-g -Wall -Wcast-qual"

  In file included from gelf_xlate.c:166:
  version_xlate.h: In function 'elf_cvt_Verdef':
  version_xlate.h:74:31: error: cast discards 'const' qualifier from pointer
target type [-Werror=cast-qual]
         dsrc = (GElf_Verdef *) ((char *) src + def_offset);
                                 ^

2. CFLAGS="-g -O2 -Wstack-protector"

    CC       readelf.o
  readelf.c: In function 'open_input_section':
  readelf.c:581:1: error: stack protector not protecting local variables:
variable length buffer [-Werror=stack-protector]
   open_input_section (int fd)
   ^~~~~~~~~~~~~~~~~~

> BTW for make check to work correctly you do of course need debuginfo, so you
> really need CLAGS="-g -Og".

Yes, sorry. Forgot about the unconditional -g passing (we do it all the time).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2018-11-23 23:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 16:29 [Bug general/23914] New: " slyfox at inbox dot ru
2018-11-23 20:25 ` [Bug general/23914] " mark at klomp dot org
2018-11-23 23:42 ` slyfox at inbox dot ru [this message]
2018-11-28 13:41 ` mark at klomp dot org
2018-12-02 23:41 ` slyfox at inbox dot ru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-23914-10460-dYbvqlxqev@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).