verify: document conflict with -Wnested-externs
authorEric Blake <eblake@redhat.com>
Fri, 20 Jul 2012 22:48:46 +0000 (16:48 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 20 Jul 2012 22:48:46 +0000 (16:48 -0600)
Our implementation of verify() relies on nested extern declarations,
so it is incompatible with gcc < 4.6 coupled with -Wnested-externs
when used inside a function body.  But inside a function body, you
can always arrange to use verify_expr() instead, which is warning-free.

* lib/verify.h: Give hint about usage when gcc warnings are enabled.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/verify.h

index 2fa6fd5..69437c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-07-20  Eric Blake  <eblake@redhat.com>
 
+       verify: document conflict with -Wnested-externs
+       * lib/verify.h: Give hint about usage when gcc warnings are enabled.
+
        maint.mk: forbid exit(-1)
        * top/maint.mk (sc_prohibit_magic_number_exit): Detect negatives.
 
index cef14ad..0c320b1 100644 (file)
        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.
 
      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.  */