]> git.saurik.com Git - bison.git/blobdiff - src/complain.h
c++: style: use "unsigned", not "unsigned int"
[bison.git] / src / complain.h
index 10ea19bf7675aa1d3cda1e55a7342a0807951f9e..63347785c38b6a040cbf6a654a754207ed9cc0f3 100644 (file)
@@ -1,6 +1,6 @@
 /* Declaration for error-reporting function for Bison.
 
-   Copyright (C) 2000-2002, 2006, 2009-2013 Free Software Foundation,
+   Copyright (C) 2000-2002, 2006, 2009-2015 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -35,6 +35,7 @@ typedef enum
     warning_yacc,           /**< POSIXME.  */
     warning_conflicts_sr,   /**< S/R conflicts.  */
     warning_conflicts_rr,   /**< R/R conflicts.  */
+    warning_empty_rule,     /**< Implicitly empty rules.  */
     warning_deprecated,     /**< Obsolete constructs.  */
     warning_precedence,     /**< Useless precedence and associativity.  */
     warning_other,          /**< All other warnings.  */
@@ -85,6 +86,7 @@ typedef enum
     Wconflicts_sr     = 1 << warning_conflicts_sr,
     Wconflicts_rr     = 1 << warning_conflicts_rr,
     Wdeprecated       = 1 << warning_deprecated,
+    Wempty_rule       = 1 << warning_empty_rule,
     Wprecedence       = 1 << warning_precedence,
     Wother            = 1 << warning_other,
 
@@ -96,9 +98,13 @@ typedef enum
     no_caret          = 1 << 14, /**< Do not display caret location.  */
 
     /**< All above warnings.  */
-    Wall              = ~complaint & ~fatal & ~silent
+    Weverything       = ~complaint & ~fatal & ~silent,
+    Wall              = Weverything & ~Wyacc
   } warnings;
 
+/** Whether the warnings of \a flags are all unset.
+    (Never enabled, never disabled). */
+bool warning_is_unset (warnings flags);
 
 /** Make a complaint, with maybe a location.  */
 void complain (location const *loc, warnings flags, char const *message, ...)
@@ -118,14 +124,18 @@ void complain_indent (location const *loc, warnings flags, unsigned *indent,
 void deprecated_directive (location const *loc,
                            char const *obsolete, char const *updated);
 
-/** Warnings treated as errors shouldn't stop the execution as regular errors
-    should (because due to their nature, it is safe to go on). Thus, there are
-    three possible execution statuses.  */
+/** Report a repeated directive for a rule.  */
+void duplicate_directive (char const *directive,
+                          location first, location second);
+
+/** Warnings treated as errors shouldn't stop the execution as regular
+    errors should (because due to their nature, it is safe to go
+    on). Thus, there are three possible execution statuses.  */
 typedef enum
   {
-    status_none,
-    status_warning_as_error,
-    status_complaint
+    status_none,             /**< No diagnostic issued so far.  */
+    status_warning_as_error, /**< A warning was issued (but no error).  */
+    status_complaint         /**< An error was issued.  */
   } err_status;
 
 /** Whether an error was reported.  */