- Mixing wchar and normal output is forbidden by the C standard
authorMatthias Braun <matze@braunis.de>
Sat, 29 Nov 2008 09:03:11 +0000 (09:03 +0000)
committerMatthias Braun <matze@braunis.de>
Sat, 29 Nov 2008 09:03:11 +0000 (09:03 +0000)
   (and fails on linux but not on BSD)

[r24133]

diagnostic.c
format_check.c

index eacf085..65e0de2 100644 (file)
@@ -66,12 +66,6 @@ static void diagnosticvf(const char *const fmt, va_list ap)
                                        fputc(*f, stderr);
                                        break;
 
-                               case 'C': {
-                                       const wint_t val = va_arg(ap, wint_t);
-                                       fputwc(val, stderr);
-                                       break;
-                               }
-
                                case 'c': {
                                        const unsigned char val = (unsigned char) va_arg(ap, int);
                                        fputc(val, stderr);
index aedea18..ea3359b 100644 (file)
@@ -517,7 +517,7 @@ eval_fmt_mod_unsigned:
                                break;
 
                        default:
-                               warningf(pos, "encountered unknown conversion specifier '%%%C' at position %u", (wint_t)fmt, num_fmt);
+                               warningf(pos, "encountered unknown conversion specifier '%%%c' at position %u", (char) fmt, num_fmt);
                                if (arg == NULL) {
                                        warningf(pos, "too few arguments for format string");
                                        return;
@@ -580,7 +580,7 @@ next_arg:
                arg = arg->next;
        }
        if (!atend(&vchar)) {
-               warningf(pos, "format string contains NUL");
+               warningf(pos, "format string contains '\0'");
        }
        if (arg != NULL) {
                unsigned num_args = num_fmt;
@@ -852,7 +852,7 @@ eval_fmt_mod_unsigned:
                                break;
 
                        default:
-                               warningf(pos, "encountered unknown conversion specifier '%%%C' at position %u", (wint_t)fmt, num_fmt);
+                               warningf(pos, "encountered unknown conversion specifier '%%%c' at position %u", (char) fmt, num_fmt);
                                if (arg == NULL) {
                                        warningf(pos, "too few arguments for format string");
                                        return;