aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-08-14 03:22:24 +0000
committerRichard Stallman <rms@gnu.org>1993-08-14 03:22:24 +0000
commit0bc9c2526844e064f4f032d0de56164a7c44581f (patch)
treee47a03251028a29b33770bb7ab76844845ac86b9 /gcc
parent34a25822f31ebd055230c65e3b5fba3044c62558 (diff)
downloadgcc-0bc9c2526844e064f4f032d0de56164a7c44581f.zip
gcc-0bc9c2526844e064f4f032d0de56164a7c44581f.tar.gz
gcc-0bc9c2526844e064f4f032d0de56164a7c44581f.tar.bz2
(check_format): For scan of "%["...
(check_format): For scan of "%[", skip over scan set til closing ']' to avoid processing it as ordinary format characters. From-SVN: r5160
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 2088f00..0479965 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1716,6 +1716,21 @@ check_format (info, params)
format_char);
warning (message);
}
+ if (info->is_scan && format_char == '[')
+ {
+ /* Skip over scan set, in case it happens to have '%' in it. */
+ if (*format_chars == '^')
+ ++format_chars;
+ /* Find closing bracket; if one is hit immediately, then
+ it's part of the scan set rather than a terminator. */
+ if (*format_chars == ']')
+ ++format_chars;
+ while (*format_chars && *format_chars != ']')
+ ++format_chars;
+ if (*format_chars != ']')
+ /* The end of the format string was reached. */
+ warning ("no closing `]' for `%%[' format");
+ }
if (suppressed)
{
if (index (fci->flag_chars, '*') == 0)