From b147427aa16309657856bd9ec6ef50c60b241e18 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 30 Nov 2020 23:57:11 +0100 Subject: Make string_t always use const_string_t This will allow to relieve constraints in callers, e.g. dir_lookup("") would otherwise produce a warning with gcc-11 since char[1024] would mean that dir_lookup would read all 1024 characters while it is not. * utils.c (UserVarQualifier): Also use const_ qualifier when type is string_t. * tests/includes/types.h (const_string_t): New type. --- tests/includes/types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/includes/types.h b/tests/includes/types.h index 0bb914c..c8c3afd 100644 --- a/tests/includes/types.h +++ b/tests/includes/types.h @@ -29,6 +29,7 @@ typedef struct char_struct { } char_struct_t; typedef char* string_t; +typedef const char* const_string_t; static inline int8_t int_to_int8(int n) { return (int8_t) n; -- cgit v1.2.3