From: Paul F. <pj...@wa...> - 2025-05-12 19:49:31
|
On 5/11/25 15:27, Florian Krohm wrote: > > To get -Wformat warnings for those the only thing to do is to add > -fhosted at the end of the CFLAGS thereby overriding -fno-builtin. > > drd/drd_intercepts > helgrind/hg_intercepts > preload shared objects > > These get compiled with AM_CFLAGS_PSO_BASE but adding -fhosted to > those made memcheck/tests/wcpncpy fail. It seems to me that those > flags are particularly crafted. So I left it alone. > > Attached patch regtested on x86_64-linux-gnu and s390x-ibm-linux-gnu > with no failures. > Hi Florian, I played around with this patch and it seems OK. One little nit, there's a missing second underscore in the first #ifdef in this part of the diff +#ifdef __GNUC_ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-zero-length" +#endif printf(""); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif LLVM clang also defines __GNUC__ so to make things GCC only you also need "&& !defined(__clang__)" I think that it would be cleaner just to fix the printf: printf("%s", ""); A+ Paul |