Pass the destination buffer size minus one to strncpy
Copying the last byte was pointless, since the next line overwrites it,
and resulted in a compiler warning:
../src/intel/common/intel_measure.c: In function 'intel_measure_init':
../src/intel/common/intel_measure.c:68:7: warning: 'strncpy' specified bound 1024 equals destination size [-Wstringop-truncation]
68 | strncpy(env_copy, env, 1024);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
This allows dropping -Wno-error=stringop-truncation from the
debian-x86_64-asan & debian-{arm64,x86_64}-ubsan CI jobs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39429>
This commit is contained in:
parent
ed180a1c20
commit
a74ffd6900
3 changed files with 2 additions and 5 deletions
|
|
@ -60,7 +60,6 @@ debian-x86_64-asan:
|
|||
VULKAN_DRIVERS: "swrast,amd,intel"
|
||||
GALLIUM_DRIVERS: "llvmpipe,softpipe,zink,r300"
|
||||
C_ARGS: >
|
||||
-Wno-error=stringop-truncation
|
||||
-Wno-error=deprecated-declarations
|
||||
EXTRA_OPTION: >
|
||||
-D intel-elk=false
|
||||
|
|
@ -149,7 +148,6 @@ debian-x86_64-ubsan:
|
|||
variables:
|
||||
C_ARGS: >
|
||||
-Wno-error=stringop-overflow
|
||||
-Wno-error=stringop-truncation
|
||||
-Wno-error=deprecated-declarations
|
||||
CPP_ARGS: >
|
||||
-Wno-error=array-bounds
|
||||
|
|
@ -533,7 +531,6 @@ debian-arm64-ubsan:
|
|||
C_ARGS: >
|
||||
-Wno-error=array-bounds
|
||||
-Wno-error=stringop-overflow
|
||||
-Wno-error=stringop-truncation
|
||||
-Wno-error=deprecated-declarations
|
||||
CPP_ARGS: >
|
||||
-Wno-error=array-bounds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue