From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69025 invoked by alias); 28 Nov 2018 13:41:02 -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 68943 invoked by uid 48); 28 Nov 2018 13:40:57 -0000 From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug general/23914] Add --disable-werror to ./configure support (example trigger: CFLAGS=-Og Date: Wed, 28 Nov 2018 13:41: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: mark at klomp dot org 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/msg00203.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23914 --- Comment #3 from Mark Wielaard --- (In reply to Sergei Trofimovich from comment #2) > Gentoo allows users to control CC and CFLAGS and thus the space for getti= ng > a warning is wide. People frequently use things like -Wcast-qual or other > high signal-to-noise flags for their purposes. If they do and don't care about the warnings, then why don't they simply add -Wno-error too? > My favourite example is > ./configure CFLAGS=3D"-g -Wall" # works today without failures > or even ./configure CC=3Dclang CFLAGS=3D"-g -Weverything" but elfutils do= es not > seem to support clang. Yes, -Wall is one of the warnings we explicitly enable. See config/eu.am for the full list. Some have configure checks to make sure the compiler actually supports it. And some sadly have to be disabled for some specific source fi= les. If you have concrete warning flags you would like to see enabled by default please do submit them, but we do like to enable them only once the code bas= e is clean. Then we enable them by default and will always catch whenever new co= de produces a warning (because of -Werror). An -Weverything flag seems silly, some warnings don't really mix, some are = for style issues. IMHO warnings are only interesting if you can take some actio= n to correct the code. clang support would be nice, but clang doesn't support various GNU C extensions, there is a configure check for it though, so as soon as clang actually support -std=3Dgnu99 it should work. > Real-world examples used by people: >=20 > 1. CFLAGS=3D"-g -Wall -Wcast-qual" >=20 > 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 poin= ter > target type [-Werror=3Dcast-qual] > dsrc =3D (GElf_Verdef *) ((char *) src + def_offset); > ^ There are a lot of cast-qual warnings. It might make sense to clean them up. But it might be hard since in some cases we support overlapping src/dest buffers which might be marked "wrongly" in the external API. > 2. CFLAGS=3D"-g -O2 -Wstack-protector" >=20 > 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) > ^~~~~~~~~~~~~~~~~~ That in itself wouldn't warn. I assume you are using -fstack-protector[-all|strong] too. The warning is correct. We do already support -Wstack-usage. But it is disa= bled for a couple of files. readelf.c is one of them (see src/Makefile.am). --=20 You are receiving this mail because: You are on the CC list for the bug.