All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: outreachy@lists.linux.dev
Subject: Re: Compilation errors
Date: Fri, 1 Apr 2022 12:13:57 +0200	[thread overview]
Message-ID: <20220401121357.09ae33d7@elisabeth> (raw)
In-Reply-To: <3603561.MHq7AAxBmi@leap>

Hi Fabio,

On Fri, 01 Apr 2022 11:35:13 +0200
"Fabio M. De Francesco" <fmdefrancesco@gmail.com> wrote:

> Hello everybody,
> 
> I've made hundreds of Linux builds and never had problems, but since 
> few days I'm not anymore able to compile the kernel with GCC or Clang.
> 
> I get many errors like the following and the build crashes:
> 
> # CC=gcc-11 make -j12
> [...]
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c: In function ‘bnx2x_check_blocks_with_parity3’:
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c:4917:4: error: case label does not reduce to an integer constant
>     case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY:
> [...]
> make[5]: *** [scripts/Makefile.build:289: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.o] Error 1
> make[4]: *** [scripts/Makefile.build:551: drivers/net/ethernet/broadcom/bnx2x] Error 2
> make[4]: *** Waiting for unfinished jobs....
> 
> One more example...
> 
> # make mrproper
> # CC=clang make -j12
> [...]
> drivers/usb/typec/tcpm/tcpm.c:4724:3: error: case label does not reduce to an integer constant
>    case BDO_MODE_TESTDATA:
>    ^~~~
> make[4]: *** [scripts/Makefile.build:288: drivers/usb/typec/tcpm/tcpm.o] Error 1
> make[3]: *** [scripts/Makefile.build:550: drivers/usb/typec/tcpm] Error 2
> make[2]: *** [scripts/Makefile.build:550: drivers/usb/typec] Error 2
> make[2]: *** Waiting for unfinished jobs....
> 
> Can someone help me to understand what is happening and how to fix this issue?
> Could it depend on a configuration option that, unintentionally enabled, make 
> the build fail whenever "case label does not reduce to an integer constant" is 
> hit? If so, which option?

Those would be warnings, but kernel builds switched to -Werror by
default a while ago, see commit 3fe617ccafd6 ("Enable '-Werror' by
default for all kernel builds") -- meaning that all warnings are
treated as errors. You can disable CONFIG_WERROR:

	scripts/config -d WERROR

to double check. But I guess you just found a source of very useful,
relatively trivial patches. :) Of course, chances are that some of
those are already fixed in some other tree.

As to why it started happening for you recently: maybe you just
switched to gcc 11 and a newer version of clang? Can you try with
gcc 10 if you have it still installed?

-- 
Stefano


  reply	other threads:[~2022-04-01 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  9:35 Compilation errors Fabio M. De Francesco
2022-04-01 10:13 ` Stefano Brivio [this message]
2022-04-01 12:01   ` Fabio M. De Francesco
2022-04-01 12:57     ` Stefano Brivio
2022-04-01 13:07       ` Fabio M. De Francesco
2022-04-01 16:09         ` Alison Schofield
2022-04-01 17:58           ` Fabio M. De Francesco
2022-04-01 14:39       ` Fabio M. De Francesco
  -- strict thread matches above, loose matches on Subject: below --
2008-07-01 11:21 compilation errors Jean-Francois Moine
2008-02-05  2:59 Compilation errors Peter Teoh
1999-02-03 14:31 Richard Hartensveld
1999-02-03 17:12 ` Alex deVries
1999-02-03 20:43   ` Ulf Carlsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220401121357.09ae33d7@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=outreachy@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.