PR c/17880 -Wsequence-point doesn't warn inside if, while, do conditions, for beg/cond/end expressions etc.

Manuel López-Ibáñez lopezibanez@gmail.com
Sat Aug 9 11:03:00 GMT 2008


Fixed by calling verify_sequence_points at the appropriate places.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
--enable-languages=all.

OK for trunk?

2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR c/17880
	* c-typeck.c (digest_init): Call verify_sequence_points from here.
	(c_finish_return): Likewise.
	(c_start_case): Likewise.
	* c-common.c (warn_for_collisions_1): Use explicit location in
	warning.
	* c-parser.c (c_parser_condition): New. Call
	verify_sequence_points.
	(c_parser_paren_condition): Call c_parser_condition.
	(c_parser_for_statement): Call c_parser_condition.
testsuite/
	* gcc.dg/sequence-pt-pr17880.c: New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-pr17880.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080809/686d2055/attachment.ksh>


More information about the Gcc-patches mailing list