Re: [PATCH] kallsyms: work around bogus -Wrestrict warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 8 Jan 2020 10:26:02 +0900 Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

> Hi Arnd,
> 
> On Tue,  7 Jan 2020 22:40:26 +0100
> Arnd Bergmann <arnd@xxxxxxxx> wrote:
> 
> > gcc -O3 produces some really odd warnings for this file:
> > 
> > kernel/kallsyms.c: In function 'sprint_symbol':
> > kernel/kallsyms.c:369:3: error: 'strcpy' source argument is the same as destination [-Werror=restrict]
> >    strcpy(buffer, name);
> >    ^~~~~~~~~~~~~~~~~~~~
> > kernel/kallsyms.c: In function 'sprint_symbol_no_offset':
> > kernel/kallsyms.c:369:3: error: 'strcpy' source argument is the same as destination [-Werror=restrict]
> >    strcpy(buffer, name);
> >    ^~~~~~~~~~~~~~~~~~~~
> > kernel/kallsyms.c: In function 'sprint_backtrace':
> > kernel/kallsyms.c:369:3: error: 'strcpy' source argument is the same as destination [-Werror=restrict]
> >    strcpy(buffer, name);
> >    ^~~~~~~~~~~~~~~~~~~~
> > 
> > This obviously cannot be since it is preceded by an 'if (name != buffer)'
> > check.
> 
> Hmm, this looks like a bug in gcc.

Yes, we're getting a lot of such reports.  I don't think current gcc is
ready for this patch so I'll drop it, sorry.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux