Make the input encoding selectable via −finput‐charset=. Currently suported are...
[cparser] / diagnostic.c
index 585d61b..babdf9d 100644 (file)
@@ -68,7 +68,7 @@ static void diagnosticvf(const char *const fmt, va_list ap)
 
                                case 'C': {
                                        const wint_t val = va_arg(ap, wint_t);
-                                       fputwc(val, stderr);
+                                       fprintf(stderr, "%lc", val);
                                        break;
                                }
 
@@ -127,6 +127,12 @@ static void diagnosticvf(const char *const fmt, va_list ap)
                                        break;
                                }
 
+                               case 't': {
+                                       const token_t *const token = va_arg(ap, const token_t*);
+                                       print_pp_token(stderr, token);
+                                       break;
+                               }
+
                                case 'K': {
                                        const token_t* const token = va_arg(ap, const token_t*);
                                        print_token(stderr, token);