On Sat, 2019-12-14 at 12:04 +0300, Dmitry V. Levin wrote:
On Fri, Dec 06, 2019 at 05:07:24PM +0100, Tomas Mraz wrote:
> The attached patch fixes all warnings encountered in build with
> -Wall
> -Wextra options with gcc-9.2.1.
>
> I had to suppress two warnings for bison/flex generated code.
>
> OK to commit?
[...]
> --- a/libpamc/include/security/pam_client.h
> +++ b/libpamc/include/security/pam_client.h
> @@ -109,7 +109,7 @@ char **pamc_list_agents(pamc_handle_t pch);
>
> #define PAM_BP_RENEW(old_p, cntrl,
> data_length) \
> do
> {
> \
> - if (old_p)
> { \
> + if (old_p != NULL)
> { \
> if (*(old_p))
> { \
> u_int32_t
> __size; \
> __size =
> PAM_BP_SIZE(*(old_p)); \
I wonder why this hunk suppresses any warnings.
If it really helps, then it has to be (old_p).
This suppresses "the address of ‘binary_prompt’ will always evaluate as
‘true’" warning. I have adjusted it before committing.
The rest of the change looks OK, although I haven't checked
whether
it
suppresses *all* warnings.
It does for me for -Wall -Wextra with gcc-9.2.1. However I did not try
to disable features that are disablable via configure and compile
without them.
--
Tomáš Mráz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb
[You'll know whether the road is wrong if you carefully listen to your
conscience.]