Commit 3d5cb23d by Marek Polacek Committed by Marek Polacek

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
parent d39023b4
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));
......
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 ...
......
/* 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" } */
}
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