summaryrefslogtreecommitdiff
path: root/lib/verify.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-05-29 18:48:09 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-05-29 18:50:54 -0700
commit96a263f7953ec80851c81f3a1f40127600b7ea7b (patch)
tree0c2303d2a1b216eae8e665badb7c4f4fdfec65f3 /lib/verify.h
parent55ba71f47850fbd870cb08bac1cf992f1368295e (diff)
downloadgnulib-96a263f7953ec80851c81f3a1f40127600b7ea7b.tar.gz
c-ctype, regex, verify: port to gcc -std=c90 -pedantic
Avoid constructions that are rejected by gcc -std=c90 -pedantic. This fixes a porting bug I recently reintroduced in regex, and some other instances that I discovered while testing the fix. * lib/c-ctype.h [__STRICT_ANSI__]: Avoid ({ ... }). * lib/regcomp.c (utf8_sb_map) [__STRICT_ANSI__]: Avoid [0 ... N] = E. * lib/regex_internal.h [!_LIBC && GNULIB_LOCK]: Do not use a macro with an empty argument if this is a pedantic pre-C99 GCC. * lib/verify.h: Do not use _Static_assert if this is a pedantic pre-C11 GCC.
Diffstat (limited to 'lib/verify.h')
-rw-r--r--lib/verify.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/verify.h b/lib/verify.h
index cb8e90b542..03492efcd3 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -31,7 +31,9 @@
Use this only with GCC. If we were willing to slow 'configure'
down we could also use it with other compilers, but since this
affects only the quality of diagnostics, why bother? */
-# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus
+# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+ && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
+ && !defined __cplusplus)
# define _GL_HAVE__STATIC_ASSERT 1
# endif
/* The condition (99 < __GNUC__) is temporary, until we know about the