From: rusty@rustcorp.com.au (Rusty Russell)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] serial/atmel_serial: Fix another fallout of the change to BUILD_BUG_ON
Date: Tue, 20 Oct 2009 01:02:29 +1030 [thread overview]
Message-ID: <200910200102.30478.rusty@rustcorp.com.au> (raw)
In-Reply-To: <4ADC3D3C020000780001AA10@vpn.id2.novell.com>
On Mon, 19 Oct 2009 06:49:40 pm Jan Beulich wrote:
> >>> Rusty Russell <rusty@rustcorp.com.au> 19.10.09 08:08 >>>
> >How's this? It's not quite valid C, but it "works":
>
> But that's not what you proposed initially, i.e. generating a link time
> error if a compile time error can't be generated (and only if even a link
> time error isn't possible, a run time one should be forced).
Yeah, this was cleverer. A compile time is nicer than link time. And this
is *actually* what I want: a compile fail if the compiler knows enough, runtime
otherwise.
> And btw., why do you think this isn't valid C?
>From my glance at ISO C, non-positive sized variable length arrays are
invalid. gcc here seems to give the expected results (eg. sizeof gives
a negative result).
Cheers,
Rusty.
next prev parent reply other threads:[~2009-10-19 14:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 7:08 [PATCH] serial/atmel_serial: Fix another fallout of the change to BUILD_BUG_ON Uwe Kleine-König
2009-10-13 7:26 ` Haavard Skinnemoen
2009-10-13 7:40 ` Jan Beulich
2009-10-19 6:08 ` Rusty Russell
2009-10-19 8:19 ` Jan Beulich
2009-10-19 14:32 ` Rusty Russell [this message]
2009-10-13 8:24 ` Uwe Kleine-König
2009-10-21 12:27 ` Russell King - ARM Linux
2009-10-21 13:56 ` Uwe Kleine-König
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=200910200102.30478.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).