All of lore.kernel.org
 help / color / mirror / Atom feed
* older gccs and case labels producing integer constants
@ 2022-04-05  9:50 Borislav Petkov
  2022-04-05  9:58 ` Richard Biener
  2022-04-05 12:23 ` Peter Zijlstra
  0 siblings, 2 replies; 16+ messages in thread
From: Borislav Petkov @ 2022-04-05  9:50 UTC (permalink / raw)
  To: linux-toolchains; +Cc: Michael Matz, Richard Biener, lkml

Hi folks,

I'm starting to see failures like this on allmodconfig builds:

sound/usb/midi.c: In function ‘snd_usbmidi_out_endpoint_create’:
sound/usb/midi.c:1389:2: error: case label does not reduce to an integer constant
  case (((0xfc08) << 16) | (0x0101)):
  ^~~~

(The case statement is a macro but it evaluates to what I have there)

and that thing fails with

$ gcc --version
gcc (SUSE Linux) 7.5.0

although it doesn't have any problems building with newer compilers.

I'm presuming older gccs consider those case statements signed ints and
the following fixes it:

  case ((((unsigned int)0xfc08) << 16) | (0x0101)):

and I guess we can whack the couple of occurrences but what I'm
wondering is why does this work with newer gccs?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2022-04-07 15:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  9:50 older gccs and case labels producing integer constants Borislav Petkov
2022-04-05  9:58 ` Richard Biener
2022-04-05 10:04   ` Borislav Petkov
2022-04-05 10:06   ` Richard Biener
2022-04-05 10:36     ` Borislav Petkov
2022-04-05 10:45       ` Borislav Petkov
2022-04-05 11:41         ` Richard Biener
2022-04-07 15:16           ` Borislav Petkov
2022-04-05 11:37       ` Richard Biener
2022-04-06  9:53       ` Jakub Jelinek
2022-04-06 10:04         ` Jakub Jelinek
2022-04-05 12:23 ` Peter Zijlstra
2022-04-05 12:39   ` Michael Matz
2022-04-05 12:53     ` Richard Biener
2022-04-05 13:04       ` Borislav Petkov
2022-04-06 10:13   ` Jakub Jelinek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.