On Sat, 2024-07-20 at 06:52 +0100, Sam James wrote:
> Some distributions like Gentoo make -Wformat and -Wformat-security
> enabled by default. Pass -Wno-format to the test to avoid a spurious
> fail in such environments.
> 
> gcc/testsuite/
>       PR rtl-optimization/115929
>       * gcc.dg/torture/pr115929-1.c: Pass -Wno-format.
> ---

IMO if you are patching GCC downstream to enable some options, you can
patch the test case in the same .patch file anyway instead of pushing it
upstream.

If we take the responsibility to make the test suite anticipate random
downstream changes, the test suite will ended up filled with different
workarounds for 42 distros.

If we have to anticipate downstream changes we should make a policy
about which changes we must anticipate (hmm and if we'll anticipate -
Wformat by default why not add a configuration option for it by the
way?), or do it in a more generic way (using a .spec file to explicitly
give the "baseline" options for testing?)

> Richard, is this OK? I could adjust the testcase if you prefer.
> 
> Please commit on my behalf if it's fine. Thanks.
> 
>  gcc/testsuite/gcc.dg/torture/pr115929-1.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/torture/pr115929-1.c 
> b/gcc/testsuite/gcc.dg/torture/pr115929-1.c
> index 19b831ab99ef..d81081e2f2e9 100644
> --- a/gcc/testsuite/gcc.dg/torture/pr115929-1.c
> +++ b/gcc/testsuite/gcc.dg/torture/pr115929-1.c
> @@ -1,5 +1,5 @@
>  /* { dg-require-effective-target lp64 } */
> -/* { dg-options "-fno-gcse -fschedule-insns -fno-guess-branch-probability 
> -fno-tree-fre -fno-tree-ch" } */
> +/* { dg-options "-fno-gcse -fschedule-insns -fno-guess-branch-probability 
> -fno-tree-fre -fno-tree-ch -Wno-format" } */
>  
>  int printf(const char *, ...);
>  int a[6], b, c;
> 

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to