This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] assert.h: allow gcc to detect assert(a = 1) errors


On 11/24/2016 03:21 AM, Jim Meyering wrote:

We *do* need that __STRICT_ANSI__ disjunct.
Otherwise, this would evoke no warning:

  $ gcc -isystem. -I. -Werror=pedantic k.c
  In file included from k.c:1:0:
  k.c: In function ‘main’:
  k.c:2:23: warning: ISO C forbids braced-groups within expressions [-Wpedantic]
   int main() { assert ( ({1;}) ); return 0; }

Agreed.

Tests I ran manually in a directory with the new assert.h file:

Do you require a test suite addition for these? If so, would a single
bourne shell script be acceptable?

We currently lack the machinery for that. It's not just that it would need a shell script. We also do not compile tests with headers as system headers.

The patch looks good to me, but it needs a ChangeLog entry.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]