Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719588

Re: [PATCH net-next] compiler: Document behavior compiling with -O0

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH net-next] compiler: Document behavior compiling with -O0
Date 2017-08-24 23:30 +0200
Message-ID <ui7Ro-3tg-25@gated-at.bofh.it> (permalink)
References <ui3uq-zR-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 24, 2017 at 6:45 PM, Joe Stringer <joe@ovn.org> wrote:
> Recent changes[0] to make use of __compiletime_assert() from container_of()
> increased the scope of this macro, resulting in a wider set of
> situations where developers cannot compile their code using "-O0". I
> noticed this when making use of the macro in my own development, and
> spent more time than I'd like to admit tracking the problem down. This
> patch documents the behavior in lieu of a compile-time assertion
> implementation that does not rely on optimizations.
>
> Example compilation failure:

Maybe the macro should be enclosed in "#ifdef __OPTIMIZE__"?

Generally speaking we at least rely on function inlining to create a
working kernel, but sometimes there may be a reason to compile a
single file without optimizations.

        Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next] compiler: Document behavior compiling with -O0 Joe Stringer <joe@ovn.org> - 2017-08-24 18:50 +0200
  Re: [PATCH net-next] compiler: Document behavior compiling with -O0 Joe Stringer <joe@ovn.org> - 2017-08-24 19:00 +0200
  Re: [PATCH net-next] compiler: Document behavior compiling with -O0 Arnd Bergmann <arnd@arndb.de> - 2017-08-24 23:30 +0200
    Re: [PATCH net-next] compiler: Document behavior compiling with -O0 Joe Stringer <joe@ovn.org> - 2017-08-25 23:00 +0200
  Re: [PATCH net-next] compiler: Document behavior compiling with -O0 Michal Nazarewicz <mina86@mina86.com> - 2017-08-25 13:50 +0200
    Re: [PATCH net-next] compiler: Document behavior compiling with -O0 Joe Stringer <joe@ovn.org> - 2017-08-25 23:00 +0200

csiph-web