Patch: format checking conditional expressions
Jeffrey A Law
law@cygnus.com
Mon Oct 16 09:10:00 GMT 2000
In message <Pine.LNX.4.21.0010141418380.26954-100000@kern.srcf.societies.cam.
ac.uk>you write:
> This patch adds support for format checking to go down both branches
> of a conditional expression. (Some people wish to use -Wformat=2 as a
> paranoid check for format string bugs; conditional expressions are one
> of the major problems with doing this, and this patch fixes that.)
>
> Bootstrapped with no regressions on i686-pc-linux-gnu (after applying
> http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00340.html and
> http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00388.html ). OK to
> commit?
>
> gcc/ChangeLog:
> 2000-10-14 Joseph S. Myers <jsm28@cam.ac.uk>
>
> * c-common.c (format_check_results): New structure.
> (finish_dollar_format_checking): Adjust to take a
> format_check_results * parameter.
> (check_format_info, check_format_info_recurse,
> check_format_info_main): Split check_format_info into three
> functions, the main checking going in check_format_info_main.
> Recurse when any reduction of the format string argument towards a
> string literal is done; go down both branches of a conditional
> expression. Don't warn for extra format arguments or empty format
> strings if they only occur in some branches of a conditional
> expression.
>
> gcc/testsuite/ChangeLog:
> 2000-10-14 Joseph S. Myers <jsm28@cam.ac.uk>
>
> * gcc.dg/format-branch-1.c: New test.
Approved. Please install.
Thanks,
jeff
More information about the Gcc-patches
mailing list