mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Santos <danielfsantos@att.net>
To: Jan Beulich <JBeulich@suse.com>
Cc: Daniel Santos <daniel.santos@pobox.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	david.daney@cavium.com, kosaki.motohiro@jp.fujitsu.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] utilize _Static_assert() for BUILD_BUG_ON() when the compiler supports it
Date: Thu, 13 Dec 2012 15:20:13 -0600	[thread overview]
Message-ID: <50CA468D.2020403@att.net> (raw)
In-Reply-To: <50C9B14602000078000B00C3@nat28.tlf.novell.com>

On 12/13/2012 03:43 AM, Jan Beulich wrote:
>>>> On 13.12.12 at 01:29, Daniel Santos<danielfsantos@att.net>  wrote:
>> Wow, it's really easy to miss parallel development on the same issue.
>> Sorry for my late response to this thread.  I started another thread
>> addressing these issues (as well as a few others) back in September
>> (https://lkml.org/lkml/2012/9/28/1136).  I've finally gotten ACKs from
>> maintainers with v6 of the patches (here
>> https://lkml.org/lkml/2012/11/20/621) and I'm just waiting for 3.8-rc1
>> to re-submit them.  I actually submitted these patches back in June as
>> part of a larger patch set, but broke it apart in September (I had way
>> to many changes for one patch set)
> Since yours is apparently ready to go in, but doesn't use
> _Static_assert, I guess I'll wait for it to appear until I re-work
> whatever might be left to actually make use of _Static_assert.
>
> Jan
>
Interesting! They've enabled it by default (I suppose as an extension?) 
in every standard (except -pedantic of course). One minor draw-back is 
that it appears to enjoy escaping tickmarks in the error message.  I've 
opened a bug for it (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55678)

But realistically, the "compiletime_assert" macro I wrote in compiler.h 
can be renamed to "static_assert", analogous to C11's static_assert from 
assert.h (§7.2 of C11) and it can expand to the _Static_assert keyword, 
when that is available.

Something else that I didn't consider too much before was support for 
compiling -O0 or -O1, which will cause many expressions that are 
otherwise evaluated as compile-time constants to become non-constant and 
result in failed assertions.  This isn't anything new however, building 
-O0 has been broken for quite some time, but I presume it could help 
some development of out of tree modules.


  reply	other threads:[~2012-12-13 21:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 14:47 Jan Beulich
2012-11-05  2:19 ` Rusty Russell
2012-11-05  8:46   ` Jan Beulich
2012-11-05 22:29 ` Andrew Morton
2012-11-06  1:51   ` Rusty Russell
2012-11-06  9:23     ` Jan Beulich
2012-11-07  1:03       ` Rusty Russell
2012-11-07  8:05         ` Jan Beulich
2012-11-07 23:24           ` Rusty Russell
2012-12-13  0:29             ` Daniel Santos
2012-12-13  9:43               ` Jan Beulich
2012-12-13 21:20                 ` Daniel Santos [this message]
2012-12-13  0:48       ` Daniel Santos

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=50CA468D.2020403@att.net \
    --to=danielfsantos@att.net \
    --cc=JBeulich@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=daniel.santos@pobox.com \
    --cc=david.daney@cavium.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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

Powered by JetHome