Warn that the '0' flag is ignored, if the precision is present in a format specification.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 7 Jul 2011 12:12:18 +0000 (14:12 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 7 Jul 2011 12:12:18 +0000 (14:12 +0200)
format_check.c

index 16eafd1..b550672 100644 (file)
@@ -228,6 +228,10 @@ break_fmt_flags:
 
                /* precision */
                if (fmt == '.') {
+                       if (fmt_flags & FMT_FLAG_ZERO) {
+                               warningf(WARN_FORMAT, pos, "'0' flag ignored with precision in conversion specification %u", num_fmt);
+                       }
+
                        ++num_args;
                        fmt = *(++c);
                        if (fmt == '*') {