[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warnings with -O0
From: |
Matteo Croce |
Subject: |
Re: warnings with -O0 |
Date: |
Fri, 25 Oct 2024 00:06:43 +0200 |
Il giorno gio 24 ott 2024 alle ore 20:39 Sergey Poznyakoff
<gray@gnu.org.ua> ha scritto:
>
> Matteo Croce <technoboy85@gmail.com> ha escrit:
>
> > while I generally agree that modern compilers _sometimes_ are too
> > pedantic, in this case we have a macro, paxfatal(),
>
> It is not a macro, but a function.
>
> > which accepts two arguments
>
> It takes a variable number of arguments and is declared as
>
> _Noreturn void paxfatal (int, char const *, ...)
>
> The error message you are referring to seems a false positive,
> indeed. FWIW, it can be avoided by replacing
>
> paxfatal (0, 0, _("Invalid value for record_size"));
> with
> paxfatal (0, 0, "%s", _("Invalid value for record_size"));
>
Yes it's a function, sorry. It was a macro when FATAL_ERROR() was
used, but now it's been replaced by paxfatal().
Sorry I don't understand this one. First argument is an error code,
second is a printf-like format string and others are optional.
In src/buffer.c the second argument, the format string, is passed as
0, and the format string is passed as third.
Seems to me that it's a leftover which had to be done here, where the
second argument was removed because it was always 0:
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=0dfcfa4aa48440f2641f80f71d0f4a75bd1fd0fb
> > Either the 'dir' pointer is never NULL (and the check is useless),
>
> It is never NULL and the check is useless. I'll remove this later,
> when my load permits me.
>
That's exactly what I proposed here:
https://lists.gnu.org/archive/html/bug-tar/2024-09/msg00005.html
> Regards,
> Sergey
Regards,
--
Matteo Croce
perl -e 'for($t=0;;$t++){print chr($t*($t>>8|$t>>13)&255)}' |aplay