]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/builtins.c
* builtins.c (unterminated_array): Add new arguments.
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Oct 2018 14:08:53 +0000 (14:08 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Oct 2018 14:08:53 +0000 (14:08 +0000)
commitfec27bf230c370d284fb8b41ea237b2ce14d13c1
tree0ca3592e4948a9bcd6eeb25e34636deb6d1732e5
parent4429133c7570bfef5ce5deb2fb3e124ec59dee9c
* builtins.c (unterminated_array): Add new arguments.
If argument is not terminated, bubble up size and exact
state to callers.
(expand_builtin_strnlen): Detect, avoid expanding
and diagnose unterminated arrays.
(c_strlen): Fill in offset of start of unterminated strings.
* builtins.h (unterminated_array): Update prototype.

* gcc.dg/warn-strnlen-no-nul.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264787 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/builtins.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/warn-strnlen-no-nul.c [new file with mode: 0644]