This is the mail archive of the
mailing list for the glibc project.
Re: fix build errors with -DNDEBUG
- From: Martin Sebor <msebor at gmail dot com>
- To: Carlos O'Donell <carlos at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Sun, 26 Jul 2015 17:31:39 -0600
- Subject: Re: fix build errors with -DNDEBUG
- Authentication-results: sourceware.org; auth=none
- References: <55A83361 dot 6010506 at gmail dot com> <20150717020539 dot GF5641 at vapier> <87pp3r9lco dot fsf at igel dot home> <20150720072047 dot GO5641 at vapier> <55ACF099 dot 4050301 at redhat dot com> <55ADBEEE dot 6030401 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1507221717340 dot 21570 at digraph dot polyomino dot org dot uk> <55AFD628 dot 2020000 at gmail dot com> <55B28F9A dot 8010802 at redhat dot com>
Given that, are there any objections to the patch?
Please don't check this in for 2.22.
Please restart this discussion with a new thread when 2.23 opens.
I think each of these cases you cover needs to be reviewed independently
and fixed correctly.
The patch is a handful of trivial changes that add attribute
unused to local variables that are only used in the assert or
assert_perror macros. When glibc is compiled with -NDEBUG the
macros expand to nothing and, without the attribute or some
similar annotation, GCC complains about the variables being
unused. (I haven't investigated the "may be uninitialized"
warning but initializing variables is always safe so this
change too is innocuous.)
I don't see what about this is worth spending any more than
has already been spent.
If you have specific concerns with the change as your comment
about fixing each problem correctly suggests, can you please
explain what they are?
PS I came across this problem while building glibc for RHEL
where the build scripts adds -DNDEBUG option to the command
line. Releasing glibc that doesn't build that way will
require either introducing a RHEL-specific patch for it
if 2.22 is adopted, or removing the -DNDEBUG. I assume
avoiding both is preferable.