warnings: avoid warnings from clang
authorAkim Demaille <akim@lrde.epita.fr>
Mon, 8 Oct 2012 07:17:20 +0000 (09:17 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Mon, 8 Oct 2012 07:51:52 +0000 (09:51 +0200)
commit34076080cd70857ca371ed8038d81acfe3f68bca
tree85ba1e33b9b17541dc068b3c5833e8250bdcb497
parent321d3e35d52c3a118e4fd574ec63e667c330a40e
warnings: avoid warnings from clang

Fix the following warning

  parse-gram.c:2078:14: error: equality comparison with extraneous parentheses
                        [-Werror,-Wparentheses-equality]
    if (((yyn) == (-91)))
         ~~~~~~^~~~~~~~
  parse-gram.c:2078:14: note: remove extraneous parentheses around the
                        comparison to silence this warning
    if (((yyn) == (-91)))
        ~      ^       ~
  parse-gram.c:2078:14: note: use '=' to turn this equality comparison into
                        an assignment
    if (((yyn) == (-91)))
               ^~
               =
  1 error generated.

and the following one:

  input.cc:740:1: error: function declared 'noreturn' should not return
                         [-Werror,-Winvalid-noreturn]
  static void yyMemoryExhausted (yyGLRStack* yystackp)
    __attribute__ ((__noreturn__));
  static void
  yyMemoryExhausted (yyGLRStack* yystackp)
  {
    YYLONGJMP (yystackp->yyexception_buffer, 2);
  }
  ^
  1 warning and 1 error generated.

This is Apple clang version 3.1 (tags/Apple/clang-318.0.61).

* data/c.m4 (b4_table_value_equals): Use (!!(A == B)) instead of (A == B)
to avoid this warning.
Any reasonable compiler should generate the same code.
* src/uniqstr.h (UNIQSTR_EQ): Likewise.
* data/glr.c (LONGJMP): abort after longjmp to pacify clang.
data/c.m4
data/glr.c
src/uniqstr.h