From: Daniel Santos <daniel.santos@pobox.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Ian Abbott <abbotti@mev.co.uk>
Subject: Re: [PATCH] compiler.h: fix error in BUILD_BUG_ON() reporting
Date: Tue, 31 Mar 2020 19:53:45 -0500 [thread overview]
Message-ID: <88a1f7e9-596b-1973-a122-b90ef5a36af4@pobox.com> (raw)
In-Reply-To: <20200331223638.GA53668@ubuntu-m2-xlarge-x86>
On 3/31/20 5:36 PM, Nathan Chancellor wrote:
> On Tue, Mar 31, 2020 at 05:25:38PM -0500, Daniel Santos wrote:
>>
>> This will break builds using gcc 4.2 and earlier and the expectation was
>> that you don't put two of them on the same line -- not helpful in macros
>> where it all must be on the same line. Is gcc 4.2 still supported? If
>> so, I recommend using another macro for the unique number that uses
>> __COUNTER__ if available and __LINE__ otherwise. This was the decision
>> for using __LINE__ when I wrote the original anyway.
>>
>> Also note that this construct:
>>
>> BUILD_BUG_ON_MSG(0, "I like chicken"); BUILD_BUG_ON_MSG(1, "I don't like
>> chicken");
>>
>> will incorrectly claim that I like chicken. This is because of how
>> __attribute__((error)) works -- gcc will use the first declaration to
>> define the error message.
>>
>> I couple of years ago, I almost wrote a gcc extension to get rid of this
>> whole mess and just __builtin_const_assert(cond, msg). Maybe I'll
>> finish that this year.
>>
>> Daniel
> No, GCC 4.6 is the minimum required version and it is highly likely that
> the minimum version of GCC will be raised to 4.8 soon:
>
> https://lore.kernel.org/lkml/20200123153341.19947-10-will@kernel.org/
> https://git.kernel.org/peterz/queue/c/0e75b883b400ac4b1dafafe3cbd2e0a39b714232
>
> Cheers,
> Nathan
Thank you Nathan. In that case this is definitely what we want now.
Reviewed-by: Daniel Santos <daniel.santos@pobox.com>
Cheers,
Daniel
prev parent reply other threads:[~2020-04-01 0:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 11:26 Vegard Nossum
2020-03-31 17:31 ` Masahiro Yamada
2020-03-31 18:20 ` Joe Perches
2020-03-31 18:56 ` Rasmus Villemoes
2020-03-31 19:00 ` Joe Perches
2020-03-31 19:05 ` Rasmus Villemoes
2020-03-31 19:08 ` Vegard Nossum
2020-04-01 1:12 ` Daniel Santos
2020-03-31 22:30 ` Daniel Santos
2020-03-31 22:25 ` Daniel Santos
2020-03-31 22:36 ` Nathan Chancellor
2020-04-01 0:53 ` Daniel Santos [this message]
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=88a1f7e9-596b-1973-a122-b90ef5a36af4@pobox.com \
--to=daniel.santos@pobox.com \
--cc=abbotti@mev.co.uk \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=natechancellor@gmail.com \
--cc=vegard.nossum@oracle.com \
--cc=yamada.masahiro@socionext.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®