Xi Ruoyao <xry...@xry111.site> writes:

> 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.

It's a fair argument.

That said, you did say the same thing reflexively about -fhardened, even
if this is a different situation ;)

One might argue that especially for torture/, supporting "not
unreasonable" random flags is not a bad thing.

>
> 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.
>

My counterpoint would be that there are certain warnings we know various
distros enable by default, and various warnings where it's not
inconceivable we might do them upstream at some point.

Being loose about conformance in test cases is part of why the C99
enforcement took a while.

> 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?)
>

Anyway, I take the point, but it was cheaper to ask with a patch
attached than have it in my head and not know what the position was.

I like the .spec idea. In the past, we used custom .spec extensively
downstream, and we stopped before my tenure. My intention long-term with
Arsen is to bring it back as it feels like a better fit.

I'm also happy to adjust the testcase given I reproduced the original
issue fine. Or to leave it if the consensus is to. Whatever works for me.

I dare say we're spending time talking about it than the occasional
-Wno- costs though.

>> Richard, is this OK? I could adjust the testcase if you prefer.
>> 
>> [...]

thanks,
sam

Attachment: signature.asc
Description: PGP signature

Reply via email to