re PR c/65066 (ICE: Segmentation fault with -Wformat=2)
PR c/65066 * c-format.c (check_format_types): Handle null param. * gcc.dg/pr65066.c: New test. From-SVN: r220732
This commit is contained in:
parent
d39023b4d5
commit
3d5cb23da1
|
@ -1,3 +1,8 @@
|
|||
2015-02-16 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/65066
|
||||
* c-format.c (check_format_types): Handle null param.
|
||||
|
||||
2015-02-13 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/65040
|
||||
|
|
|
@ -2492,6 +2492,7 @@ check_format_types (location_t loc, format_wanted_type *types)
|
|||
&& TREE_CODE (cur_type) == INTEGER_TYPE
|
||||
&& warn_format_signedness
|
||||
&& TYPE_UNSIGNED (wanted_type)
|
||||
&& cur_param != NULL_TREE
|
||||
&& TREE_CODE (cur_param) == NOP_EXPR)
|
||||
{
|
||||
tree t = TREE_TYPE (TREE_OPERAND (cur_param, 0));
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2015-02-16 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/65066
|
||||
* gcc.dg/pr65066.c: New test.
|
||||
|
||||
2015-02-16 Ilya Enkovich <ilya.enkovich@intel.com>
|
||||
|
||||
* gcc.dg/pr65002.C: Move ...
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* PR c/65066 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wformat=2" } */
|
||||
|
||||
extern int sscanf (const char *restrict, const char *restrict, ...);
|
||||
int *a;
|
||||
|
||||
void
|
||||
foo ()
|
||||
{
|
||||
sscanf (0, "0x%x #", a); /* { dg-warning "expects argument of type" } */
|
||||
}
|
Loading…
Reference in New Issue