From 6c4aa5f6bd8aacf51ddceb78239a7a2da0a1b959 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Tue, 2 Oct 2018 14:08:53 +0000 Subject: builtins.c (unterminated_array): Add new arguments. * 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. Co-Authored-By: Jeff Law From-SVN: r264787 --- gcc/builtins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/builtins.h') diff --git a/gcc/builtins.h b/gcc/builtins.h index 3801251..cf4f9b1 100644 --- a/gcc/builtins.h +++ b/gcc/builtins.h @@ -111,7 +111,7 @@ extern internal_fn associated_internal_fn (tree); extern internal_fn replacement_internal_fn (gcall *); extern void warn_string_no_nul (location_t, const char *, tree, tree); -extern tree unterminated_array (tree); +extern tree unterminated_array (tree, tree * = NULL, bool * = NULL); extern tree max_object_size (); #endif /* GCC_BUILTINS_H */ -- cgit v1.1