diff options
author | David Malcolm <dmalcolm@redhat.com> | 2023-08-21 21:13:19 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2023-08-21 21:13:19 -0400 |
commit | 3b691e0190c6e7291f8a52e1e14d8293a28ff4ce (patch) | |
tree | eee77267219569549a3bdfabb6861abed4fd27f8 /gcc/fortran/resolve.cc | |
parent | 4325c82736d9e8a14b312fd1558e2788b69278cd (diff) | |
download | gcc-3b691e0190c6e7291f8a52e1e14d8293a28ff4ce.zip gcc-3b691e0190c6e7291f8a52e1e14d8293a28ff4ce.tar.gz gcc-3b691e0190c6e7291f8a52e1e14d8293a28ff4ce.tar.bz2 |
analyzer: check format strings for null termination [PR105899]
This patch extends -fanalyzer to check the format strings of calls
to functions marked with '__attribute__ ((format...))'.
The only checking done in this patch is to check that the format string
is a valid null-terminated string; this patch doesn't attempt to check
the content of the format string.
gcc/analyzer/ChangeLog:
PR analyzer/105899
* call-details.cc (call_details::call_details): New ctor.
* call-details.h (call_details::call_details): New ctor decl.
(struct call_arg_details): Move here from region-model.cc.
* region-model.cc (region_model::check_call_format_attr): New.
(region_model::check_call_args): Call it.
(struct call_arg_details): Move it to call-details.h.
* region-model.h (region_model::check_call_format_attr): New decl.
gcc/testsuite/ChangeLog:
PR analyzer/105899
* gcc.dg/analyzer/attr-format-1.c: New test.
* gcc.dg/analyzer/sprintf-1.c: Update expected results for
now-passing tests.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/fortran/resolve.cc')
0 files changed, 0 insertions, 0 deletions