From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 987 invoked by alias); 23 Nov 2018 23:42:47 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 939 invoked by uid 48); 23 Nov 2018 23:42:43 -0000 From: "slyfox at inbox dot ru" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: general X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at inbox dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2018-q4/txt/msg00181.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23914 --- Comment #2 from Sergei Trofimovich --- (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 res= ort to manual patching of build system. I would suggest having --enable-werror enabled by default. That way we woul= d 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 >=20 > 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 >=20 > Does Gentoo show any other compile errors? Yes. I can trigger a lot of them passing various warning flags (I'll post t= hose 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=3D"-g -Wall" # works today without failures or even ./configure CC=3Dclang CFLAGS=3D"-g -Weverything" but elfutils does= not seem to support clang. Real-world examples used by people: 1. CFLAGS=3D"-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=3Dcast-qual] dsrc =3D (GElf_Verdef *) ((char *) src + def_offset); ^ 2. CFLAGS=3D"-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=3Dstack-protector] open_input_section (int fd) ^~~~~~~~~~~~~~~~~~ > BTW for make check to work correctly you do of course need debuginfo, so = you > really need CLAGS=3D"-g -Og". Yes, sorry. Forgot about the unconditional -g passing (we do it all the tim= e). --=20 You are receiving this mail because: You are on the CC list for the bug.