]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
warnings: fusion of complain and complain_at
[bison.git] / data / c.m4
index 6133823d28ae07134cb92a426ec890d95abb4567..3bc2c215df60c5373cc8bab1a5b039cb26af1f0e 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -30,19 +30,21 @@ m4_define([b4_tocpp],
 # ------------------
 # A valid C macro name to use as a CPP header guard for FILE.
 m4_define([b4_cpp_guard],
-[b4_tocpp(m4_defn([b4_prefix])/[$1])])
+[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]])
 
 
 # b4_cpp_guard_open(FILE)
 # b4_cpp_guard_close(FILE)
 # ------------------------
-# Open/close CPP inclusion guards for FILE.
+# If FILE does not expand to nothing, open/close CPP inclusion guards for FILE.
 m4_define([b4_cpp_guard_open],
+[m4_ifval(m4_quote($1),
 [#ifndef b4_cpp_guard([$1])
-# define b4_cpp_guard([$1])])
+# define b4_cpp_guard([$1])])])
 
 m4_define([b4_cpp_guard_close],
-[#endif b4_comment([!b4_cpp_guard([$1])])])
+[m4_ifval(m4_quote($1),
+[#endif b4_comment([!b4_cpp_guard([$1])])])])
 
 
 ## ---------------- ##
@@ -195,12 +197,11 @@ m4_define([b4_int_type_for],
 # --------------------------------------------
 # Without inducing a comparison warning from the compiler, check if the
 # literal value LITERAL equals VALUE from table TABLE, which must have
-# TABLE_min and TABLE_max defined.  YYID must be defined as an identity
-# function that suppresses warnings about constant conditions.
+# TABLE_min and TABLE_max defined.
 m4_define([b4_table_value_equals],
 [m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
                || m4_indir([b4_]$1[_max]) < $3), [1],
-       [[YYID (0)]],
+       [[0]],
        [[((]$2[) == (]$3[))]])])
 
 
@@ -407,15 +408,14 @@ b4_syncline([@oline@], [@ofile@])
     break;])
 
 
-# b4_yydestruct_generate
-# ----------------------
+# b4_yydestruct_define
+# --------------------
 # Define the "yydestruct" function.
-m4_define_default([b4_yydestruct_generate],
+m4_define_default([b4_yydestruct_define],
 [[/*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-/*ARGSUSED*/
 ]b4_function_define([yydestruct],
     [static void],
     [[const char *yymsg],    [yymsg]],
@@ -439,16 +439,15 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
 ])
 
 
-# b4_yy_symbol_print_generate
-# ---------------------------
+# b4_yy_symbol_print_define
+# -------------------------
 # Define the "yy_symbol_print" function.
-m4_define_default([b4_yy_symbol_print_generate],
+m4_define_default([b4_yy_symbol_print_define],
 [[
 /*--------------------------------.
 | Print this symbol on YYOUTPUT.  |
 `--------------------------------*/
 
-/*ARGSUSED*/
 ]b4_function_define([yy_symbol_value_print],
     [static void],
                [[FILE *yyoutput],                       [yyoutput]],
@@ -582,7 +581,7 @@ m4_define([b4_yylloc_default_define],
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
     do                                                                  \
-      if (YYID (N))                                                     \
+      if (N)                                                            \
         {                                                               \
           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
@@ -596,6 +595,6 @@ m4_define([b4_yylloc_default_define],
           (Current).first_column = (Current).last_column =              \
             YYRHSLOC (Rhs, 0).last_column;                              \
         }                                                               \
-    while (YYID (0))
+    while (0)
 #endif
 ]])