This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] assert.h: allow gcc to detect assert(a = 1) errors
- From: Florian Weimer <fweimer at redhat dot com>
- To: Jim Meyering <jim at meyering dot net>
- Cc: Roland McGrath <roland at hack dot frob dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 16 Dec 2016 13:15:17 +0100
- Subject: Re: [PATCH] assert.h: allow gcc to detect assert(a = 1) errors
- Authentication-results: sourceware.org; auth=none
- References: <1405537923-28692-1-git-send-email-jim@meyering.net> <20140716201505.34FF22C398F@topped-with-meat.com> <CA+8g5KH_vG9KY-fT8miGH9oSULCoffd5DQQbgr-GDR6d2qTktA@mail.gmail.com> <CA+8g5KFy4tk+H3t0BKoe=wQqsW+ea3ZtzOe2bb+xBUNbtxGBWg@mail.gmail.com> <93a7b09e-70b9-d11e-bfb5-e54e751c8db5@redhat.com> <CA+8g5KGiN54O-jV7-NEP-4a9FrP6tio0xp2J=V0x-QX4tfAz2A@mail.gmail.com> <42486853-b892-20d1-d8e5-c74548369e2e@redhat.com> <CA+8g5KG83STDuNKaUEhjYQAHNU5hm=+UdncBNn2hWRi0m2q6KQ@mail.gmail.com>
On 12/15/2016 01:24 AM, Jim Meyering wrote:
Thanks. I didn't realize glibc used such a strict interpretation.
Happy to adjust. How's this (also in the attached, rebased commit):
Let gcc detect assert(a = 1) errors.
* assert/assert.h (assert) Rewrite, retaining the old definintion
when required, but otherwise putting the expression as-is in an "if"
expression (hence, with no added parentheses) within a statement
expression.
Thanks. I just noticed your fb.com address in the ChangeLog. Do you
know if Facebook have filed paperwork with the FSF for glibc? Commit
7ee03f00188723a4de2b85021e511ced6d7fc4be was just two lines, and this
commit here only adds only very few significant source lines, too, so we
might get away without the paperwork, but this is probably the last such
change we can accept.
Anyway, please install if you have commit access.
Thanks,
Florian