[Bug bootstrap/78859] profiledbootstrap failure caused by -Werror=nonnull
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 19 14:23:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78859
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> (In reply to Martin Liška from comment #0)
> > There are 2 (so far) errors reported:
> >
> > 1) gengtype.c:
> >
> > ../../gcc/gengtype.c: In function ‘const char*
> > get_file_srcdir_relative_path(const input_file*)’:
> > ../../gcc/gengtype.c:1760:14: error: argument 1 null where non-null expected
> > [-Werror=nonnull]
> > if (strlen (f) > srcdir_len
> > ~~~~~~~^~~
> >
> > This is real bug, following patch fixes that:
>
> Only iff get_file_srcdir_relative_path is ever called with NULL inpf. If
> not, it is a false positive. As strlen would crash if it is called with
> NULL and it has not been reported yet, it clearly is not.
So with the following patch (and -disable-werror) the profiledbootstrap
finishes:
@@ -75,9 +75,8 @@ const char *get_file_srcdir_relative_path (const input_file
*inpf);
static inline const char*
get_input_file_name (const input_file *inpf)
{
- if (inpf)
- return inpf->inpname;
- return NULL;
+ gcc_assert (inpf);
+ return inpf->inpname;
}
Thus, it's regression.
More information about the Gcc-bugs
mailing list