This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/82652] missing -Wstringop-overflow on strncpy with -fcheck-pointer-bounds


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82652

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The problem is that there are no BUILT_IN_{STPNCPY,STRNCAT,STRNCPY}_CHKP macros
so these built-ins, even though their built-in function codes exist, are
handled just like ordinary functions.  To get the benefit of the compile-time
overflow checking the corresponding BUILT_IN_XXX_CHKP macros need to be added
along with handlers for them.

The following is the set of the built-ins for which the corresponding _CHKP
macros are defined.

$ find gcc -name "*.def" ! -path "*/testsuite/*" | xargs grep _CHKP | sed -n
"s/.*(\(BUILT_IN_[^, ]*\), *.*/\1/p"  | sort -u
BUILT_IN_CHKP_BNDCL
BUILT_IN_CHKP_BNDCU
BUILT_IN_CHKP_BNDLDX
BUILT_IN_CHKP_BNDMK
BUILT_IN_CHKP_BNDRET
BUILT_IN_CHKP_BNDSTX
BUILT_IN_CHKP_CHECK_PTR_BOUNDS
BUILT_IN_CHKP_CHECK_PTR_LBOUNDS
BUILT_IN_CHKP_CHECK_PTR_UBOUNDS
BUILT_IN_CHKP_COPY_PTR_BOUNDS
BUILT_IN_CHKP_EXTRACT_LOWER
BUILT_IN_CHKP_EXTRACT_UPPER
BUILT_IN_CHKP_GET_PTR_LBOUND
BUILT_IN_CHKP_GET_PTR_UBOUND
BUILT_IN_CHKP_INIT_PTR_BOUNDS
BUILT_IN_CHKP_INTERSECT
BUILT_IN_CHKP_MEMCPY_NOBND
BUILT_IN_CHKP_MEMCPY_NOBND_NOCHK
BUILT_IN_CHKP_MEMCPY_NOCHK
BUILT_IN_CHKP_MEMMOVE_NOBND
BUILT_IN_CHKP_MEMMOVE_NOBND_NOCHK
BUILT_IN_CHKP_MEMMOVE_NOCHK
BUILT_IN_CHKP_MEMPCPY_NOBND
BUILT_IN_CHKP_MEMPCPY_NOBND_NOCHK
BUILT_IN_CHKP_MEMPCPY_NOCHK
BUILT_IN_CHKP_MEMSET_NOBND
BUILT_IN_CHKP_MEMSET_NOBND_NOCHK
BUILT_IN_CHKP_MEMSET_NOCHK
BUILT_IN_CHKP_NARROW
BUILT_IN_CHKP_NARROW_PTR_BOUNDS
BUILT_IN_CHKP_NULL_PTR_BOUNDS
BUILT_IN_CHKP_SET_PTR_BOUNDS
BUILT_IN_CHKP_SIZEOF
BUILT_IN_CHKP_STORE_PTR_BOUNDS
BUILT_IN_MEMCPY
BUILT_IN_MEMCPY_CHK
BUILT_IN_MEMMOVE
BUILT_IN_MEMMOVE_CHK
BUILT_IN_MEMPCPY
BUILT_IN_MEMPCPY_CHK
BUILT_IN_MEMSET
BUILT_IN_MEMSET_CHK
BUILT_IN_STPCPY
BUILT_IN_STPCPY_CHK
BUILT_IN_STRCAT
BUILT_IN_STRCAT_CHK
BUILT_IN_STRCHR
BUILT_IN_STRCPY
BUILT_IN_STRCPY_CHK
BUILT_IN_STRLEN

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]