[cmake] gcc.cmake: Set -Wno-error=clobbered.

Fixes what appears to be a false-positive warning-as-error in the
Release build:

src/librpbase/img/RpPng.cpp: In function ‘LibRpTexture::rp_image_ptr LibRpBase::RpPng::loadPng(png_structp, png_infop)’:
src/librpbase/img/RpPng.cpp:181:42: error: variable ‘color’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
  181 |                                 argb32_t color;
      |                                          ^~~~~
cc1plus: all warnings being treated as errors
This commit is contained in:
David Korth 2025-04-06 20:31:36 -04:00
parent eddb20e0f9
commit c69c9f864e

View File

@ -274,7 +274,7 @@ IF(CFLAG_OPTIMIZE_FTREE_VECTORIZE)
ENDIF(CFLAG_OPTIMIZE_FTREE_VECTORIZE)
# Add "-Werror" *after* checking for everything else.
SET(RP_IGNORE_ERRORS "-Wno-error=unknown-pragmas -Wno-error=address-of-packed-member -Wno-error=address -Wno-error=attributes -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=ignored-qualifiers -Wno-error=missing-field-initializers -Wno-error=unused-variable -Wno-error=unused-function -Wno-error=type-limits -Wno-error=empty-body -Wno-error=shift-negative-value")
SET(RP_IGNORE_ERRORS "-Wno-error=unknown-pragmas -Wno-error=address-of-packed-member -Wno-error=address -Wno-error=attributes -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=ignored-qualifiers -Wno-error=missing-field-initializers -Wno-error=unused-variable -Wno-error=unused-function -Wno-error=type-limits -Wno-error=empty-body -Wno-error=shift-negative-value -Wno-error=clobbered")
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} -Werror ${RP_IGNORE_ERRORS}")
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} -Werror ${RP_IGNORE_ERRORS}")