X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Fverify.h;h=03492efcd3f4a5c2beaafb5ba8ea372f4ece957f;hb=0d38bb29df7384f3f67f9b69257c9595d111e63f;hp=cef14ad1571eb64a9f4006f696645b265dbf339f;hpb=dc84183747ce1703eb99685b5dbde1f65a143c06;p=debian%2Fgzip diff --git a/lib/verify.h b/lib/verify.h index cef14ad..03492ef 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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 @@ -125,7 +127,7 @@ extern int (*dummy (void)) [sizeof (struct {...})]; * GCC warns about duplicate declarations of the dummy function if - -Wredundant_decls is used. GCC 4.3 and later have a builtin + -Wredundant-decls is used. GCC 4.3 and later have a builtin __COUNTER__ macro that can let us generate unique identifiers for each dummy function, to suppress this warning. @@ -133,6 +135,10 @@ which do not support _Static_assert, also do not warn about the last declaration mentioned above. + * GCC warns if -Wnested-externs is enabled and verify() is used + within a function body; but inside a function, you can always + arrange to use verify_expr() instead. + * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */