summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-12 09:28:52 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-12 09:28:52 +0000
commite6dd34f167491c9011299274335e47fcf1d5fb71 (patch)
tree10bcbca131e9d45e6679cdb46afd7506c3c47005 /gcc/c-common.c
parent72fb8ab85f0090aa1f1301a0526dabcd74ec412d (diff)
downloadgcc-e6dd34f167491c9011299274335e47fcf1d5fb71.tar.gz
* c-common.c (decl_attributes): Don't allow strftime formats with
first_arg_num nonzero. (check_format_info): Set wanted_type and wanted_type_name to zero before they are possibly assigned and used. testsuite: * gcc.dg/format-attr-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36845 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 07384f84cab..3d3e7c209b3 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -962,6 +962,12 @@ decl_attributes (node, attributes, prefix_attributes)
}
}
+ if (format_type == strftime_format_type && first_arg_num != 0)
+ {
+ error ("strftime formats cannot format arguments");
+ continue;
+ }
+
record_function_format (DECL_NAME (decl),
DECL_ASSEMBLER_NAME (decl),
format_type, format_num, first_arg_num);
@@ -2754,6 +2760,8 @@ check_format_info (status, info, params)
status_warning (status, "no closing `]' for `%%[' format");
}
+ wanted_type = 0;
+ wanted_type_name = 0;
if (fki->flags & FMT_FLAG_ARG_CONVERT)
{
wanted_type = (fci->types[length_chars_val].type