Subject: Re: bug#55595: 29.0.50; Compilation warnings on macOS

From: Eli Zaretskii <[email-masked]>
Date: Mon, 23 May 2022 18:53:42 +0300

> Date: Mon, 23 May 2022 17:42:15 +0200
> From:  Rudolf Adamkovič via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> FYI, I see the following compilation warnings (@ commit 5a1a67a256):
> 
>   CC       comp.o
> comp.c:2816:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
> #pragma GCC diagnostic pop
>                        ^
> comp.c:4698:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
> #pragma GCC diagnostic pop
>                        ^
> comp.c:4714:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
> #pragma GCC diagnostic pop
>                        ^
> comp.c:4967:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
> #pragma GCC diagnostic pop
>                        ^
> comp.c:5351:11: warning: variable 'data_ephemeral_vec' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
>       if (!recursive_load)
>           ^~~~~~~~~~~~~~~
> comp.c:5365:28: note: uninitialized use occurs here
>       data_ephemeral_vec = data_ephemeral_vec;
>                            ^~~~~~~~~~~~~~~~~~
> comp.c:5351:7: note: remove the 'if' if its condition is always true
>       if (!recursive_load)
>       ^~~~~~~~~~~~~~~~~~~~
> comp.c:5345:46: note: initialize the variable 'data_ephemeral_vec' to silence this warning
>       Lisp_Object volatile data_ephemeral_vec;
>                                              ^
>                                               = NULL

Is this GCC or Clang?

If the latter, I guess we should disable -Wunknown-pragmas for it.

The last warning is silly, but I guess it cannot harm anyone to
initialize the variable where it's declared.