On Mon Dec 2, 2024 at 2:17 PM CET, Randy Palamar wrote:
> This is a completely bogus warning. I would be ok with it if the> behaviour was ambiguous but this is just pure compiler stupidity.
Yes, it is bogus, but the point of clearing compiler warnings is
not to fight with compiler about your opinions, but to clear them
so that some actual valid ones are not lost. I can give you there
some #pragma to switch off that warning, but it seems even more
silly to me.
Matěj
--
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
Home is where ~/.profile is.
-- from Usenet
Matěj Cepl <mcepl@cepl.eu> wrote:
> On Mon Dec 2, 2024 at 2:17 PM CET, Randy Palamar wrote:> > This is a completely bogus warning. I would be ok with it if the> > behaviour was ambiguous but this is just pure compiler stupidity.> > Yes, it is bogus, but the point of clearing compiler warnings is> not to fight with compiler about your opinions, but to clear them> so that some actual valid ones are not lost. I can give you there> some #pragma to switch off that warning, but it seems even more> silly to me.> > Matěj
I guess I should have asked but what compiler is this? I don't see
this warning with clang-18 nor with gcc-14. Are you sure this
isn't a bug with your systems toolchain?
In case it wasn't obvious I'm really not a fan having to change
code because compiler authors think they can dictate what
constitutes good or bad programming. I'm also seeing that Ubuntu's
cc introduced another broken builtin that they think they can
shove everywhere they see a strncat:
https://github.com/martanne/vis/actions/runs/12120097393/job/33788049828#step:4:68
The size there is explicitly specified, the code is correct. The
builtin is not.
All these warnings do is waste developer time.
--
https://rnpnr.xyz/
GPG Fingerprint: B8F0 CF4C B6E9 415C 1B27 A8C4 C8D2 F782 86DF 2DC5
On Mon Dec 2, 2024 at 2:43 PM CET, Randy Palamar wrote:
> I guess I should have asked but what compiler is this? I don't see> this warning with clang-18 nor with gcc-14. Are you sure this> isn't a bug with your systems toolchain?
gcc (SUSE Linux) 14.2.1 20241007 [revision 4af44f2cf7d281f3e4f3957efce10e8b2ccb2ad3]
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You are right, I will try to observe it for a moment, and if
needed to talk with my GCC colleagues.
Feel free to reject this patch.
Also:
* https://lists.sr.ht/~martanne/devel/patches/55192 ?
* https://lists.sr.ht/~martanne/devel/patches/55179 ?
Matěj
--
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
He can compress the most words into the smallest idea of any man
I know.
-- Abraham Lincoln
On Mon Dec 2, 2024 at 2:17 PM CET, Randy Palamar wrote:
> This is a completely bogus warning. I would be ok with it if the> behaviour was ambiguous but this is just pure compiler stupidity.
Right, and this is what I got from our compiler people:
# But that's not parentheses for the expression, but belong
# to the if-statement. The background for the existence of
# the warning is to ensure that 'if (x = expr)' was not a
# mistyped 'if (x == expr)'. As with many warnings it's simply a
# style-preference, if you don't want it, don't enable it.
#
# (Or, if you do enable it to catch typos, then writing 'if ((x =
# expr))' is the way to silence it in a particular case, as would
# be the full form of what actually happen in the abstract machine:
# 'if ( (x = expr) != 0 )' )
So, that’s two people talking nonsense to me in five minutes to
me. Makes me cranky.
Best,
Matěj
--
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
Ze všech kleteb otročiny, // jíž nás stihl bůh, // nejtrapnější,
nejhroznější // otrocký je duch.
Of all curses of slavery // we were pursued by God, // most
embarrassing, most terrible // is the slavish spirit.
-- my horrible translation of a beautiful verse from “Písně
otroka” [Songs of a slave] by Svatopluk Čech