Commit 3af0187c by Kaveh R. Ghazi Committed by Kaveh Ghazi

c-format.c (format_types_orig): Disallow '*' width/precision in asm_fprintf format checks.

gcc:
	* c-format.c (format_types_orig): Disallow '*' width/precision in
	asm_fprintf format checks.

testsuite:
	* gcc.dg/format/asm_fprintf-1.c: Update width/precision checks.

From-SVN: r67897
parent 281b1732
2003-06-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-format.c (format_types_orig): Disallow '*' width/precision in
asm_fprintf format checks.
2003-06-13 Ulrich Weigand <uweigand@de.ibm.com> 2003-06-13 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (s390_va_arg): Fix alignment when retrieving * config/s390/s390.c (s390_va_arg): Fix alignment when retrieving
......
...@@ -831,7 +831,7 @@ static const format_kind_info format_types_orig[] = ...@@ -831,7 +831,7 @@ static const format_kind_info format_types_orig[] =
asm_fprintf_flag_specs, asm_fprintf_flag_pairs, asm_fprintf_flag_specs, asm_fprintf_flag_pairs,
FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK, FMT_FLAG_ARG_CONVERT|FMT_FLAG_EMPTY_PREC_OK,
'w', 0, 'p', 0, 'L', 'w', 0, 'p', 0, 'L',
&integer_type_node, &integer_type_node NULL, NULL
}, },
{ "scanf", scanf_length_specs, scan_char_table, "*'I", NULL, { "scanf", scanf_length_specs, scan_char_table, "*'I", NULL,
scanf_flag_specs, scanf_flag_pairs, scanf_flag_specs, scanf_flag_pairs,
......
2003-06-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/format/asm_fprintf-1.c: Update width/precision checks.
2003-06-12 Mark Mitchell <mark@codesourcery.com> 2003-06-12 Mark Mitchell <mark@codesourcery.com>
* lib/gcc-dg.exp (dg-require-dll): New function. * lib/gcc-dg.exp (dg-require-dll): New function.
......
...@@ -34,9 +34,6 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, ...@@ -34,9 +34,6 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
asm_fprintf ("%.7d\n", i); asm_fprintf ("%.7d\n", i);
asm_fprintf ("%+9.4d\n", i); asm_fprintf ("%+9.4d\n", i);
asm_fprintf ("%.3ld\n", l); asm_fprintf ("%.3ld\n", l);
asm_fprintf ("%*d\n", i1, i);
asm_fprintf ("%.*d\n", i2, i);
asm_fprintf ("%*.*ld\n", i1, i2, l);
asm_fprintf ("%d %lu\n", i, ul); asm_fprintf ("%d %lu\n", i, ul);
/* Extensions provided in asm_fprintf. */ /* Extensions provided in asm_fprintf. */
...@@ -58,8 +55,9 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, ...@@ -58,8 +55,9 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
asm_fprintf ("%d", l); /* { dg-warning "format" "bad argument types" } */ asm_fprintf ("%d", l); /* { dg-warning "format" "bad argument types" } */
asm_fprintf ("%wd", l); /* { dg-warning "format" "bad argument types" } */ asm_fprintf ("%wd", l); /* { dg-warning "format" "bad argument types" } */
asm_fprintf ("%d", ll); /* { dg-warning "format" "bad argument types" } */ asm_fprintf ("%d", ll); /* { dg-warning "format" "bad argument types" } */
asm_fprintf ("%*.*d", l, i2, i); /* { dg-warning "field" "bad * argument types" } */ asm_fprintf ("%*d\n", i1, i); /* { dg-warning "format" "bad * argument types" } */
asm_fprintf ("%*.*d", i1, l, i); /* { dg-warning "field" "bad * argument types" } */ asm_fprintf ("%.*d\n", i2, i); /* { dg-warning "format" "bad * argument types" } */
asm_fprintf ("%*.*ld\n", i1, i2, l); /* { dg-warning "format" "bad * argument types" } */
asm_fprintf ("%ld", i); /* { dg-warning "format" "bad argument types" } */ asm_fprintf ("%ld", i); /* { dg-warning "format" "bad argument types" } */
asm_fprintf ("%s", n); /* { dg-warning "format" "bad argument types" } */ asm_fprintf ("%s", n); /* { dg-warning "format" "bad argument types" } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment