From: Andrew Morton <akpm@linux-foundation.org>
To: davem@davemloft.net, JBeulich@novell.com,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH] fix BUILD_BUG_ON() and a couple of bogus uses of it
Date: Fri, 18 Sep 2009 00:18:10 +0000 [thread overview]
Message-ID: <20090917171810.f675c8f2.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090917171504.649ba29b.akpm@linux-foundation.org>
On Thu, 17 Sep 2009 17:15:04 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
> There's a shortcoming in the current BUILD_BUG_ON() - it silently does
> nothing if passed a non-constant arg.
>
> I suspect that in the 2.6.31 code, that BUILD_BUG_ON() just does
> nothing at all, and that Jan's patch is now exposing this. It might be
> compiler-version dependent too.
>
>
> <tests it>
>
> Yup, on base 2.6.31, this:
>
> --- a/arch/sparc/kernel/vio.c~a
> +++ a/arch/sparc/kernel/vio.c
> @@ -23,6 +23,8 @@ static const struct vio_device_id *vio_m
> const char *type, *compat;
> int len;
>
> + vio_dring_avail(NULL, 33);
> +
> type = dev->type;
> compat = dev->compat;
> len = dev->compat_len;
> _
>
> compiles without error with gcc-3.4.5.
And I can't immediately find a way to make any compile-time error occur here, with
or without Jan's patch. hm.
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: davem@davemloft.net, JBeulich@novell.com,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH] fix BUILD_BUG_ON() and a couple of bogus uses of it
Date: Thu, 17 Sep 2009 17:18:10 -0700 [thread overview]
Message-ID: <20090917171810.f675c8f2.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090917171504.649ba29b.akpm@linux-foundation.org>
On Thu, 17 Sep 2009 17:15:04 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
> There's a shortcoming in the current BUILD_BUG_ON() - it silently does
> nothing if passed a non-constant arg.
>
> I suspect that in the 2.6.31 code, that BUILD_BUG_ON() just does
> nothing at all, and that Jan's patch is now exposing this. It might be
> compiler-version dependent too.
>
>
> <tests it>
>
> Yup, on base 2.6.31, this:
>
> --- a/arch/sparc/kernel/vio.c~a
> +++ a/arch/sparc/kernel/vio.c
> @@ -23,6 +23,8 @@ static const struct vio_device_id *vio_m
> const char *type, *compat;
> int len;
>
> + vio_dring_avail(NULL, 33);
> +
> type = dev->type;
> compat = dev->compat;
> len = dev->compat_len;
> _
>
> compiles without error with gcc-3.4.5.
And I can't immediately find a way to make any compile-time error occur here, with
or without Jan's patch. hm.
next prev parent reply other threads:[~2009-09-18 0:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-18 15:59 [PATCH] fix BUILD_BUG_ON() and a couple of bogus uses of it Jan Beulich
2009-09-17 23:24 ` Andrew Morton
2009-09-17 23:24 ` Andrew Morton
2009-09-18 0:01 ` David Miller
2009-09-18 0:01 ` David Miller
2009-09-18 0:15 ` Andrew Morton
2009-09-18 0:15 ` Andrew Morton
2009-09-18 0:18 ` Andrew Morton [this message]
2009-09-18 0:18 ` Andrew Morton
2009-09-18 0:31 ` David Miller
2009-09-18 0:31 ` David Miller
2009-09-18 0:45 ` David Miller
2009-09-18 0:45 ` David Miller
2009-09-22 6:45 ` Rusty Russell
2009-09-23 0:57 ` Rusty Russell
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=20090917171810.f675c8f2.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=JBeulich@novell.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.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 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.