linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* New warnings with gcc9
@ 2019-01-23 15:25 Laura Abbott
  2019-01-23 17:17 ` Miguel Ojeda
  2019-01-24 15:24 ` Miguel Ojeda
  0 siblings, 2 replies; 5+ messages in thread
From: Laura Abbott @ 2019-01-23 15:25 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Arnd Bergmann

As an FYI for anyone who is interested, gcc9 landed in Fedora rawhide
and I built the kernel as usual.

There's a very large number of warnings from -Waddress-of-packed-member e.g.

BUILDSTDERR: drivers/scsi/ipr.c: In function 'ipr_handle_config_change':
BUILDSTDERR: drivers/scsi/ipr.c:1453:22: warning: taking address of packed member of 'struct ipr_hostrcb_cfg_ch_not' may result in an unaligned pointer value [-Waddress-of-packed-member]
BUILDSTDERR:  1453 |   cfgtew.u.cfgte64 = &hostrcb->hcam.u.ccn.u.cfgte64;
BUILDSTDERR:       |

There's also some missing attribute warnings. The majority are caused by a
missing attribute in module_init/module_exit

BUILDSTDERR: In file included from drivers/scsi/hptiop.c:18:
BUILDSTDERR: ./include/linux/module.h:132:6: warning: 'init_module' specifies less restrictive attribute than its target 'hptiop_module_init': 'cold' [-Wmissing-attributes]
BUILDSTDERR:   132 |  int init_module(void) __attribute__((alias(#initfn)));
BUILDSTDERR:       |      ^~~~~~~~~~~
BUILDSTDERR: drivers/scsi/hptiop.c:1704:1: note: in expansion of macro 'module_init'
BUILDSTDERR:  1704 | module_init(hptiop_module_init);
BUILDSTDERR:       | ^~~~~~~~~~~
BUILDSTDERR: drivers/scsi/hptiop.c:1692:19: note: 'init_module' target declared here
BUILDSTDERR:  1692 | static int __init hptiop_module_init(void)
BUILDSTDERR:       |

I also hit a build failure on s390, This looks to be an issue with the assembly,
I'm in discussion with the s390 people about the proper fix.

BUILDSTDERR: ./arch/s390/include/asm/jump_label.h: Assembler messages:
BUILDSTDERR: ./arch/s390/include/asm/jump_label.h:23: Error: bad expression
BUILDSTDERR: ./arch/s390/include/asm/jump_label.h:23: Error: junk at end of line, first unrecognized character is `r'
BUILDSTDERR: make[1]: *** [scripts/Makefile.build:277: init/main.o] Error 1


This looks like a new warning due to hvclock_page being declared
u8 and then cast to a struct

BUILDSTDERR: arch/x86/entry/vdso/vclock_gettime.c: In function 'do_hres':
BUILDSTDERR: ./include/linux/compiler.h:182:26: warning: array subscript 1 is outside array bounds of 'u8[1]' {aka 'unsigned char[1]'} [-Warray-bounds]
BUILDSTDERR:   182 |  case 8: *(__u64 *)res = *(volatile __u64 *)p; break;  \
BUILDSTDERR:       |                          ^~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: ./include/linux/compiler.h:193:2: note: in expansion of macro '__READ_ONCE_SIZE'
BUILDSTDERR:   193 |  __READ_ONCE_SIZE;
BUILDSTDERR:       |  ^~~~~~~~~~~~~~~~
BUILDSTDERR: arch/x86/entry/vdso/vclock_gettime.c:37:11: note: while referencing 'hvclock_page'
BUILDSTDERR:    37 | extern u8 hvclock_page
BUILDSTDERR:       |           ^~~~~~~~~~~~

This looks like we just need to make the attributes match

BUILDSTDERR: lib/crc32.c:209:5: warning: 'crc32_le_base' specifies less restrictive attribute than its target 'crc32_le': 'pure' [-Wmissing-attributes]
BUILDSTDERR:   209 | u32 crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le);
BUILDSTDERR:       |     ^~~~~~~~~~~~~
BUILDSTDERR: lib/crc32.c:195:19: note: 'crc32_le_base' target declared here
BUILDSTDERR:   195 | u32 __pure __weak crc32_le(u32 crc, unsigned char const *p, size_t len)
BUILDSTDERR:       |                   ^~~~~~~~
BUILDSTDERR: lib/crc32.c:210:5: warning: '__crc32c_le_base' specifies less restrictive attribute than its target '__crc32c_le': 'pure' [-Wmissing-attributes]
BUILDSTDERR:   210 | u32 __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le);
BUILDSTDERR:       |     ^~~~~~~~~~~~~~~~
BUILDSTDERR: lib/crc32.c:200:19: note: '__crc32c_le_base' target declared here
BUILDSTDERR:   200 | u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len)
BUILDSTDERR:       |

I think this is a corner case in the code flow so it should
be fixed up

BUILDSTDERR: drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery':
BUILDSTDERR: drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
BUILDSTDERR:   235 |  if (ret == -EOPNOTSUPP)
BUILDSTDERR:       |     ^


There's also a bunch of warnings from -Wpragma that show up on powerpc and arm32

BUILDSTDERR: In file included from ././include/linux/compiler_types.h:68,
BUILDSTDERR:                  from <command-line>:
BUILDSTDERR: ./include/linux/compiler-gcc.h:166:20: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
BUILDSTDERR:   166 | #define __diag(s)  _Pragma(__diag_str(GCC diagnostic s))
BUILDSTDERR:       |                    ^~~~~~~
BUILDSTDERR: ./include/linux/compiler-gcc.h:169:26: note: in expansion of macro '__diag'
BUILDSTDERR:   169 | #define __diag_GCC_8(s)  __diag(s)
BUILDSTDERR:       |                          ^~~~~~
BUILDSTDERR: ./include/linux/compiler-gcc.h:157:2: note: in expansion of macro '__diag_GCC_8'
BUILDSTDERR:   157 |  __diag_GCC_ ## version(__diag_GCC_ ## severity s)
BUILDSTDERR:       |  ^~~~~~~~~~~
BUILDSTDERR: ././include/linux/compiler_types.h:212:2: note: in expansion of macro '__diag_GCC'
BUILDSTDERR:   212 |  __diag_ ## compiler(version, ignore, option)
BUILDSTDERR:       |  ^~~~~~~
BUILDSTDERR: ./include/linux/syscalls.h:237:2: note: in expansion of macro '__diag_ignore'
BUILDSTDERR:   237 |  __diag_ignore(GCC, 8, "-Wattribute-alias",   \
BUILDSTDERR:       |  ^~~~~~~~~~~~~
BUILDSTDERR: ./include/linux/syscalls.h:225:2: note: in expansion of macro '__SYSCALL_DEFINEx'
BUILDSTDERR:   225 |  __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
BUILDSTDERR:       |  ^~~~~~~~~~~~~~~~~
BUILDSTDERR: ./include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
BUILDSTDERR:   216 | #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
BUILDSTDERR:       |                                    ^~~~~~~~~~~~~~~
BUILDSTDERR: kernel/bpf/syscall.c:2580:1: note: in expansion of macro 'SYSCALL_DEFINE3'
BUILDSTDERR:  2580 | SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
BUILDSTDERR:       | ^~~~~~~~~~~~~~~


I'll see about fixing these up if someone doesn't get to them first.

Thanks,
Laura

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New warnings with gcc9
  2019-01-23 15:25 New warnings with gcc9 Laura Abbott
@ 2019-01-23 17:17 ` Miguel Ojeda
  2019-01-23 17:40   ` Miguel Ojeda
  2019-01-23 18:11   ` Miguel Ojeda
  2019-01-24 15:24 ` Miguel Ojeda
  1 sibling, 2 replies; 5+ messages in thread
From: Miguel Ojeda @ 2019-01-23 17:17 UTC (permalink / raw)
  To: Laura Abbott; +Cc: Linux Kernel Mailing List, Arnd Bergmann

Hi Laura,

On Wed, Jan 23, 2019 at 4:27 PM Laura Abbott <labbott@redhat.com> wrote:
>
> There's also some missing attribute warnings. The majority are caused by a
> missing attribute in module_init/module_exit
>
> BUILDSTDERR: In file included from drivers/scsi/hptiop.c:18:
> BUILDSTDERR: ./include/linux/module.h:132:6: warning: 'init_module' specifies less restrictive attribute than its target 'hptiop_module_init': 'cold' [-Wmissing-attributes]
> BUILDSTDERR:   132 |  int init_module(void) __attribute__((alias(#initfn)));
> BUILDSTDERR:       |      ^~~~~~~~~~~
> BUILDSTDERR: drivers/scsi/hptiop.c:1704:1: note: in expansion of macro 'module_init'
> BUILDSTDERR:  1704 | module_init(hptiop_module_init);
> BUILDSTDERR:       | ^~~~~~~~~~~
> BUILDSTDERR: drivers/scsi/hptiop.c:1692:19: note: 'init_module' target declared here
> BUILDSTDERR:  1692 | static int __init hptiop_module_init(void)
> BUILDSTDERR:       |

I have been discussing these new -Wmissing-attributes warnings with
the author, Martin Sebor. There is a new copy() attribute that we may
take advantage of, but I will send the patch I have since you already
found this :-)

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New warnings with gcc9
  2019-01-23 17:17 ` Miguel Ojeda
@ 2019-01-23 17:40   ` Miguel Ojeda
  2019-01-23 18:11   ` Miguel Ojeda
  1 sibling, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2019-01-23 17:40 UTC (permalink / raw)
  To: Laura Abbott, Martin Sebor; +Cc: Linux Kernel Mailing List, Arnd Bergmann

On Wed, Jan 23, 2019 at 6:17 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Hi Laura,
>
> On Wed, Jan 23, 2019 at 4:27 PM Laura Abbott <labbott@redhat.com> wrote:
> >
> > There's also some missing attribute warnings. The majority are caused by a
> > missing attribute in module_init/module_exit
> >
> > BUILDSTDERR: In file included from drivers/scsi/hptiop.c:18:
> > BUILDSTDERR: ./include/linux/module.h:132:6: warning: 'init_module' specifies less restrictive attribute than its target 'hptiop_module_init': 'cold' [-Wmissing-attributes]
> > BUILDSTDERR:   132 |  int init_module(void) __attribute__((alias(#initfn)));
> > BUILDSTDERR:       |      ^~~~~~~~~~~
> > BUILDSTDERR: drivers/scsi/hptiop.c:1704:1: note: in expansion of macro 'module_init'
> > BUILDSTDERR:  1704 | module_init(hptiop_module_init);
> > BUILDSTDERR:       | ^~~~~~~~~~~
> > BUILDSTDERR: drivers/scsi/hptiop.c:1692:19: note: 'init_module' target declared here
> > BUILDSTDERR:  1692 | static int __init hptiop_module_init(void)
> > BUILDSTDERR:       |
>
> I have been discussing these new -Wmissing-attributes warnings with
> the author, Martin Sebor. There is a new copy() attribute that we may
> take advantage of, but I will send the patch I have since you already
> found this :-)

[Cc'ing Martin, I forgot!]

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New warnings with gcc9
  2019-01-23 17:17 ` Miguel Ojeda
  2019-01-23 17:40   ` Miguel Ojeda
@ 2019-01-23 18:11   ` Miguel Ojeda
  1 sibling, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2019-01-23 18:11 UTC (permalink / raw)
  To: Laura Abbott, Jessica Yu; +Cc: Linux Kernel Mailing List, Arnd Bergmann

On Wed, Jan 23, 2019 at 6:17 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Hi Laura,
>
> On Wed, Jan 23, 2019 at 4:27 PM Laura Abbott <labbott@redhat.com> wrote:
> >
> > There's also some missing attribute warnings. The majority are caused by a
> > missing attribute in module_init/module_exit
> >
> > BUILDSTDERR: In file included from drivers/scsi/hptiop.c:18:
> > BUILDSTDERR: ./include/linux/module.h:132:6: warning: 'init_module' specifies less restrictive attribute than its target 'hptiop_module_init': 'cold' [-Wmissing-attributes]
> > BUILDSTDERR:   132 |  int init_module(void) __attribute__((alias(#initfn)));
> > BUILDSTDERR:       |      ^~~~~~~~~~~
> > BUILDSTDERR: drivers/scsi/hptiop.c:1704:1: note: in expansion of macro 'module_init'
> > BUILDSTDERR:  1704 | module_init(hptiop_module_init);
> > BUILDSTDERR:       | ^~~~~~~~~~~
> > BUILDSTDERR: drivers/scsi/hptiop.c:1692:19: note: 'init_module' target declared here
> > BUILDSTDERR:  1692 | static int __init hptiop_module_init(void)
> > BUILDSTDERR:       |
>
> I have been discussing these new -Wmissing-attributes warnings with
> the author, Martin Sebor. There is a new copy() attribute that we may
> take advantage of, but I will send the patch I have since you already
> found this :-)

Sent -- since someone asked me for it, here it is the reference:

  https://lore.kernel.org/lkml/20190123173707.GA16603@gmail.com/

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New warnings with gcc9
  2019-01-23 15:25 New warnings with gcc9 Laura Abbott
  2019-01-23 17:17 ` Miguel Ojeda
@ 2019-01-24 15:24 ` Miguel Ojeda
  1 sibling, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2019-01-24 15:24 UTC (permalink / raw)
  To: Laura Abbott; +Cc: Linux Kernel Mailing List, Arnd Bergmann

Hi Laura,

On Wed, Jan 23, 2019 at 4:27 PM Laura Abbott <labbott@redhat.com> wrote:
>
> This looks like we just need to make the attributes match
>
> BUILDSTDERR: lib/crc32.c:209:5: warning: 'crc32_le_base' specifies less restrictive attribute than its target 'crc32_le': 'pure' [-Wmissing-attributes]
> BUILDSTDERR:   209 | u32 crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le);
> BUILDSTDERR:       |     ^~~~~~~~~~~~~
> BUILDSTDERR: lib/crc32.c:195:19: note: 'crc32_le_base' target declared here
> BUILDSTDERR:   195 | u32 __pure __weak crc32_le(u32 crc, unsigned char const *p, size_t len)
> BUILDSTDERR:       |                   ^~~~~~~~
> BUILDSTDERR: lib/crc32.c:210:5: warning: '__crc32c_le_base' specifies less restrictive attribute than its target '__crc32c_le': 'pure' [-Wmissing-attributes]
> BUILDSTDERR:   210 | u32 __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le);
> BUILDSTDERR:       |     ^~~~~~~~~~~~~~~~
> BUILDSTDERR: lib/crc32.c:200:19: note: '__crc32c_le_base' target declared here
> BUILDSTDERR:   200 | u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len)
> BUILDSTDERR:       |

I am sending a patch for these as well, since they are also coming
from -Wmissing-attributes like the others.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-24 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23 15:25 New warnings with gcc9 Laura Abbott
2019-01-23 17:17 ` Miguel Ojeda
2019-01-23 17:40   ` Miguel Ojeda
2019-01-23 18:11   ` Miguel Ojeda
2019-01-24 15:24 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).