print tokens without surrounding ''
[cparser] / diagnostic.c
index 3e83b0b..585d61b 100644 (file)
@@ -34,8 +34,6 @@ unsigned diagnostic_count = 0;
 unsigned error_count      = 0;
 /** Number of occurred warnings. */
 unsigned warning_count    = 0;
-/** true if warnings should be inhibited */
-bool inhibit_all_warnings = false;
 
 static const source_position_t *curr_pos = NULL;
 
@@ -92,9 +90,18 @@ static void diagnosticvf(const char *const fmt, va_list ap)
                                        break;
                                }
 
+                               case 'u': {
+                                       const unsigned int val = va_arg(ap, unsigned int);
+                                       fprintf(stderr, "%u", val);
+                                       break;
+                               }
+
                                case 'Y': {
                                        const symbol_t *const symbol = va_arg(ap, const symbol_t*);
-                                       fputs(symbol->string, stderr);
+                                       if (symbol == NULL)
+                                               fputs("(null)", stderr);
+                                       else
+                                               fputs(symbol->string, stderr);
                                        break;
                                }
 
@@ -208,9 +215,6 @@ static void warningvf(const source_position_t *pos,
 
 void warningf(const source_position_t *pos, const char *const fmt, ...)
 {
-       if (inhibit_all_warnings)
-               return;
-
        va_list ap;
        va_start(ap, fmt);
        curr_pos = pos;