Simon Josefsson wrote: > As far as I can tell, all of those lines could all be replaced into > something like this: > > gl_MEGAWARNINGS([-fanalyzer -Wbad-function-cast ... # unwantedflags], > [-Wno-error=analyzer-use-of-uninitialized-value ... # error > flags])
Unfortunately, this declarative way of writing things breaks down when a warning option should only be used/avoided depending on the compiler version or on some platforms. Some packages need this ability [1][2]. > There is a lot of cut'n'paste > logical code now that is duplicated. In this case, I prefer copy&paste of some commented code, that I can adapt to my package's needs (e.g. specific options for "imported" code), than some magic in a black box. Bruno [1] https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=m4/more-warnings.m4;h=1a8afd9fe1a43f4e93e688690f43f6475a706cf1;hb=HEAD#l143 [2] https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=m4/more-warnings.m4;h=1a8afd9fe1a43f4e93e688690f43f6475a706cf1;hb=HEAD#l183