Skip to contentSkip to conversation

Lots of "error: multiple storage classes" warnings on the Linux kernel

DISCUSSION Bernd Petrovitsch 3 participants 3 messages Aug 19, 2010 – Aug 20, 2010 Sparse checker

lore
Share & tools
lore
#0 lore raw

Hi all!

While investigating something completely different, I noticed lots of "error: multiple storage classes" warnings, e.g.
---- snip ----
CHECK security/keys/keyring.c
include/linux/sched.h:831:12: error: multiple storage classes: extern weak security/keys/keyring.c:75:1: error: multiple storage classes: extern weak security/keys/keyring.c:471:1: error: multiple storage classes: extern weak security/keys/keyring.c:899:1: error: multiple storage classes: extern weak security/keys/keyring.c:974:1: error: multiple storage classes: extern weak security/keys/keyring.c:1033:1: error: multiple storage classes: extern weak ---- snip ----
[ The ": extern weak" is from me to see which are actually set. ]

Is this warning correct that way (and the source should be fixed) or is the warning in that wrong?

Bernd

Signature · 2 lines
mobile: +43 664 4416156              http://www.sysprog.at/
    Linux Software Development, Consulting and Services
#1 lore raw
Quoted 15 lines · Bernd Petrovitsch

Hi all!

While investigating something completely different, I noticed lots of "error: multiple storage classes" warnings, e.g.
---- snip ----
CHECK security/keys/keyring.c
include/linux/sched.h:831:12: error: multiple storage classes: extern weak security/keys/keyring.c:75:1: error: multiple storage classes: extern weak security/keys/keyring.c:471:1: error: multiple storage classes: extern weak security/keys/keyring.c:899:1: error: multiple storage classes: extern weak security/keys/keyring.c:974:1: error: multiple storage classes: extern weak security/keys/keyring.c:1033:1: error: multiple storage classes: extern weak ---- snip ----
[ The ": extern weak" is from me to see which are actually set. ]

Quoted 2 lines

Is this warning correct that way (and the source should be fixed) or is the warning in that wrong?

Can you cook up a small code snippet that
exhibit this without all the kernel macros etc? This would make it easier for the sparse folks to understand.

Sam

#2 lore raw
Quoted 1 line · Sam Ravnborg

On Thu, Aug 19, 2010 at 02:53:12PM +0200, Bernd Petrovitsch wrote:

[...]

Quoted 13 lines
Quoted 13 lines

While investigating something completely different, I noticed lots of "error: multiple storage classes" warnings, e.g.
---- snip ----
CHECK security/keys/keyring.c
include/linux/sched.h:831:12: error: multiple storage classes: extern weak security/keys/keyring.c:75:1: error: multiple storage classes: extern weak security/keys/keyring.c:471:1: error: multiple storage classes: extern weak security/keys/keyring.c:899:1: error: multiple storage classes: extern weak security/keys/keyring.c:974:1: error: multiple storage classes: extern weak security/keys/keyring.c:1033:1: error: multiple storage classes: extern weak ---- snip ----
[ The ": extern weak" is from me to see which are actually set. ]

Quoted 5 lines
Quoted 2 lines

Is this warning correct that way (and the source should be fixed) or is the warning in that wrong?

Can you cook up a small code snippet that
exhibit this without all the kernel macros etc?

Of course.

Quoted 1 line

This would make it easier for the sparse folks to understand.

---- snip ----
{341}echo 'extern int __attribute__((weak)) foobar(void);' | sparse -f - -:1:12: error: multiple storage classes: extern weak
---- snip ----
is a minimal example shows that.

Bernd

Signature · 2 lines
Bernd Petrovitsch                  Email : [email protected]
                     LUGA : http://www.luga.at