[cmake] gcc.cmake: Make -Woverloaded-virtual not an error.

This clang warning is currently "intentional", though I might rename the
not-virtual open() function later:

In file included from src/libromdata/Handheld/Nintendo3DS.cpp:14:
In file included from src/libromdata/Handheld/Nintendo3DS_p.hpp:19:
src/libromdata/Handheld/../disc/NCCHReader.hpp:193:24: error: 'LibRomData::NCCHReader::open' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
  193 |         LibRpFile::IRpFilePtr open(int section, const char *filename);
      |                               ^
src/libromdata/../librpbase/disc/IPartition.hpp:104:32: note: hidden overloaded virtual function 'LibRpBase::IPartition::open' declared here: different number of parameters (1 vs 2)
  104 |         virtual LibRpFile::IRpFilePtr open(const char *filename);
      |                                       ^
1 error generated.
This commit is contained in:
David Korth 2025-04-09 23:11:34 -04:00
parent 12e68aa9e7
commit 109676e30e

View File

@ -276,7 +276,7 @@ ENDIF(CFLAG_OPTIMIZE_FTREE_VECTORIZE)
# Add "-Werror" *after* checking for everything else.
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} -Werror")
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} -Werror")
SET(CFLAGS_WNO_ERROR -Wno-error=unknown-pragmas -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=address-of-packed-member -Wno-error=shift-negative-value -Wno-error=clobbered)
SET(CFLAGS_WNO_ERROR -Wno-error=unknown-pragmas -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=address-of-packed-member -Wno-error=shift-negative-value -Wno-error=clobbered -Wno-error=overloaded-virtual)
FOREACH(FLAG_TEST ${CFLAGS_WNO_ERROR})
# CMake doesn't like certain characters in variable names.
STRING(REGEX REPLACE "/|:|=" "_" FLAG_TEST_VARNAME "${FLAG_TEST}")