This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [libbacktrace] Initialize st in elf_is_symlink
- From: Jakub Jelinek <jakub at redhat dot com>
- To: James Hilliard <james dot hilliard1 at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Mar 2019 23:51:43 +0100
- Subject: Re: [PATCH] [libbacktrace] Initialize st in elf_is_symlink
- References: <20190318012150.2951-1-james.hilliard1@gmail.com> <CAKOQZ8xw6gqP=jn5dZ+2kU9-bf22G5cS09hn6gvrCpfi++WNqQ@mail.gmail.com> <CADvTj4qti7e4s992PDpQchSPkhY0y9ewJFuFKaR2=pdgDkYZBQ@mail.gmail.com> <CAKOQZ8xiKYxbmGQ5KTz7MFOf9zwh_dAKA6iHG=jCCLx+xTd_Lg@mail.gmail.com> <CADvTj4rd2SFG=qHUGQZ0bKJmu3kCP_=ARi=tLeAGOZ=Pu+4gkg@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Mar 18, 2019 at 04:41:05PM -0600, James Hilliard wrote:
> > Thanks, but I'm saying that if you look at the code you can see that
> > st is clearly initialized, by the call to lstat. I would like to see
> > an explanation for why you are seeing that warning before changing the
> > code to disable it. Initializing st should not be necessary here.
> > For example, perhaps lstat is a macro when compiling libsanitizer; if
> > that is the underlying problem, then we should fix the macro, not this
> > code.
> Yeah, I'm not sure why the compiler thinks lstat isn't initializing st.
> What should I do to debug this further?
Guess you should start by telling us which OS it is on (I can't reproduce
this warning on x86_64-linux nor i686-linux with glibc 2.28), looking at
preprocessed source to see what exactly lstat does (e.g. if it is some macro
or inline function and what exactly it is doing).
Jakub