On Thu, 2014-02-27 at 12:55 -0800, Christopher Li wrote:
> On Thu, Feb 27, 2014 at 12:39 PM, Joe Perches wrote:
> > Maybe the evaluate.c "size = bits_in_char;" assignment
> >
> > if (size == 1 && is_bool_type(type)) {
> > - warning(expr->pos, "expression using sizeof
On Thu, Feb 27, 2014 at 1:00 PM, Joe Perches wrote:
> Of course
>
The change has applied and pushed.
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at
On Thu, Feb 27, 2014 at 1:00 PM, Joe Perches wrote:
> On Thu, 2014-02-27 at 12:44 -0800, Christopher Li wrote:
>> On Thu, Feb 27, 2014 at 12:26 PM, H. Peter Anvin wrote:
>> > I would.
>> Joe, I assume you are OK with this patch, the default is now off.
>
> Of course
Let me know if you are going
On Thu, 2014-02-27 at 12:44 -0800, Christopher Li wrote:
> On Thu, Feb 27, 2014 at 12:26 PM, H. Peter Anvin wrote:
> > I would.
> Joe, I assume you are OK with this patch, the default is now off.
Of course
> diff --git a/lib.c b/lib.c
[]
> @@ -226,6 +226,7 @@ int Wparen_string = 0;
> +int
On Thu, Feb 27, 2014 at 12:39 PM, Joe Perches wrote:
> Please use V3 as I stuffed up the alphabetic order
> of sizeof and shadow.
Please send it your V3 then :-)
>
> I'm not sure it matters much, but the linux-kernel
> Makefile wouldn't need to be changed if Wsizeof_bool
> is default 0.
It
On Thu, Feb 27, 2014 at 12:26 PM, H. Peter Anvin wrote:
> I would.
>
Joe, I assume you are OK with this patch, the default is now off.
Chris
Allow an override to emit or not the sizeof(bool) warning.
Add a "-Wsizeof-bool" description to the manpage.
Signed-off-by: Joe Perches
Reviewed-by:
On Thu, 2014-02-27 at 12:26 -0800, H. Peter Anvin wrote:
> On February 27, 2014 12:22:45 PM PST, Christopher Li
> wrote:
> >OK. I get it nobody wants a sizeof(_Bool) warning.
> >I am going to apply this patch.
Please use V3 as I stuffed up the alphabetic order
of sizeof and shadow.
> >Should
I would.
On February 27, 2014 12:22:45 PM PST, Christopher Li wrote:
>On Wed, Feb 26, 2014 at 8:32 PM, H. Peter Anvin wrote:
>>
>> Quite frankly, this is silly in my opinion, *and* it is not
>guaranteed
>> by C either (read about "trap representations").
>>>
>> Anything that moves data around
On Wed, Feb 26, 2014 at 8:32 PM, H. Peter Anvin wrote:
>
> Quite frankly, this is silly in my opinion, *and* it is not guaranteed
> by C either (read about "trap representations").
>>
> Anything that moves data around in a generic fashion. It can be as
> simple as:
>
> memcpy(foo, bar,
On 27/02/14 16:52, H. Peter Anvin wrote:
> On 02/27/2014 08:10 AM, Dan Carpenter wrote:
>>
>> That last assumption has to change for the Meta architecture.
>>
>> https://lwn.net/Articles/522188/
>>
>> On meta, the structs and unions are padded to 4 bytes unless they are
>> explicitly marked as
On 02/27/2014 08:10 AM, Dan Carpenter wrote:
>
> That last assumption has to change for the Meta architecture.
>
> https://lwn.net/Articles/522188/
>
> On meta, the structs and unions are padded to 4 bytes unless they are
> explicitly marked as __packed.
>
One have to wonder how likely they
On Thu, Feb 27, 2014 at 07:48:35AM -0800, H. Peter Anvin wrote:
> > Do we have a fairly comprehensive list of what these extrastandard
> > requirements / assumptions are? It might be a good idea to have one
> > that we can point to, so that (a) people who are trying to define a
> > new
On Thu, Feb 27, 2014 at 07:48:35AM -0800, H. Peter Anvin wrote:
> No, but I think we can certainly make a list... a lot of it right now
> sits in various people's heads.
>
> Here are a couple:
>
> - Bytes are 8 bits
> - Signed integers will be 2's complement
> - sizeof char, short, int, long,
On 02/27/2014 07:24 AM, Theodore Ts'o wrote:
> On Thu, Feb 27, 2014 at 07:10:25AM -0800, H. Peter Anvin wrote:
>> Keep in mind, too, that for the kernel we don't care about the full
>> C standard but a subset. We rely on extrastandard behavior all over
>> the place. For all ABIs supported by the
On Thu, Feb 27, 2014 at 07:10:25AM -0800, H. Peter Anvin wrote:
> Keep in mind, too, that for the kernel we don't care about the full
> C standard but a subset. We rely on extrastandard behavior all over
> the place. For all ABIs supported by the kernel, sizeof(_Book) == 1
> and so everything is
Keep in mind, too, that for the kernel we don't care about the full C standard
but a subset. We rely on extrastandard behavior all over the place. For all
ABIs supported by the kernel, sizeof(_Book) == 1 and so everything is sane.
On February 27, 2014 12:25:29 AM PST, Borislav Petkov wrote:
On Wed, Feb 26, 2014 at 07:42:37PM -0800, H. Peter Anvin wrote:
> sizeof(_Bool), like for many other types, is ABI-dependent, but that
> doesn't mean it is illegitimate.
>
> I don't think C99 says that it is invalid (which means C99 doesn't
> permit is to be a packed bitmap.)
Ok, but what can be
On Wed, Feb 26, 2014 at 07:42:37PM -0800, H. Peter Anvin wrote:
sizeof(_Bool), like for many other types, is ABI-dependent, but that
doesn't mean it is illegitimate.
I don't think C99 says that it is invalid (which means C99 doesn't
permit is to be a packed bitmap.)
Ok, but what can be said
Keep in mind, too, that for the kernel we don't care about the full C standard
but a subset. We rely on extrastandard behavior all over the place. For all
ABIs supported by the kernel, sizeof(_Book) == 1 and so everything is sane.
On February 27, 2014 12:25:29 AM PST, Borislav Petkov
On Thu, Feb 27, 2014 at 07:10:25AM -0800, H. Peter Anvin wrote:
Keep in mind, too, that for the kernel we don't care about the full
C standard but a subset. We rely on extrastandard behavior all over
the place. For all ABIs supported by the kernel, sizeof(_Book) == 1
and so everything is
On 02/27/2014 07:24 AM, Theodore Ts'o wrote:
On Thu, Feb 27, 2014 at 07:10:25AM -0800, H. Peter Anvin wrote:
Keep in mind, too, that for the kernel we don't care about the full
C standard but a subset. We rely on extrastandard behavior all over
the place. For all ABIs supported by the
On Thu, Feb 27, 2014 at 07:48:35AM -0800, H. Peter Anvin wrote:
No, but I think we can certainly make a list... a lot of it right now
sits in various people's heads.
Here are a couple:
- Bytes are 8 bits
- Signed integers will be 2's complement
- sizeof char, short, int, long, and long
On Thu, Feb 27, 2014 at 07:48:35AM -0800, H. Peter Anvin wrote:
Do we have a fairly comprehensive list of what these extrastandard
requirements / assumptions are? It might be a good idea to have one
that we can point to, so that (a) people who are trying to define a
new architecture knows
On 02/27/2014 08:10 AM, Dan Carpenter wrote:
That last assumption has to change for the Meta architecture.
https://lwn.net/Articles/522188/
On meta, the structs and unions are padded to 4 bytes unless they are
explicitly marked as __packed.
One have to wonder how likely they are to
On 27/02/14 16:52, H. Peter Anvin wrote:
On 02/27/2014 08:10 AM, Dan Carpenter wrote:
That last assumption has to change for the Meta architecture.
https://lwn.net/Articles/522188/
On meta, the structs and unions are padded to 4 bytes unless they are
explicitly marked as __packed.
One
On Wed, Feb 26, 2014 at 8:32 PM, H. Peter Anvin h...@zytor.com wrote:
Quite frankly, this is silly in my opinion, *and* it is not guaranteed
by C either (read about trap representations).
Anything that moves data around in a generic fashion. It can be as
simple as:
memcpy(foo,
I would.
On February 27, 2014 12:22:45 PM PST, Christopher Li spa...@chrisli.org wrote:
On Wed, Feb 26, 2014 at 8:32 PM, H. Peter Anvin h...@zytor.com wrote:
Quite frankly, this is silly in my opinion, *and* it is not
guaranteed
by C either (read about trap representations).
Anything that
On Thu, 2014-02-27 at 12:26 -0800, H. Peter Anvin wrote:
On February 27, 2014 12:22:45 PM PST, Christopher Li spa...@chrisli.org
wrote:
OK. I get it nobody wants a sizeof(_Bool) warning.
I am going to apply this patch.
Please use V3 as I stuffed up the alphabetic order
of sizeof and shadow.
On Thu, Feb 27, 2014 at 12:26 PM, H. Peter Anvin h...@zytor.com wrote:
I would.
Joe, I assume you are OK with this patch, the default is now off.
Chris
Allow an override to emit or not the sizeof(bool) warning.
Add a -Wsizeof-bool description to the manpage.
Signed-off-by: Joe Perches
On Thu, Feb 27, 2014 at 12:39 PM, Joe Perches j...@perches.com wrote:
Please use V3 as I stuffed up the alphabetic order
of sizeof and shadow.
Please send it your V3 then :-)
I'm not sure it matters much, but the linux-kernel
Makefile wouldn't need to be changed if Wsizeof_bool
is default
On Thu, 2014-02-27 at 12:44 -0800, Christopher Li wrote:
On Thu, Feb 27, 2014 at 12:26 PM, H. Peter Anvin h...@zytor.com wrote:
I would.
Joe, I assume you are OK with this patch, the default is now off.
Of course
diff --git a/lib.c b/lib.c
[]
@@ -226,6 +226,7 @@ int Wparen_string = 0;
On Thu, Feb 27, 2014 at 1:00 PM, Joe Perches j...@perches.com wrote:
On Thu, 2014-02-27 at 12:44 -0800, Christopher Li wrote:
On Thu, Feb 27, 2014 at 12:26 PM, H. Peter Anvin h...@zytor.com wrote:
I would.
Joe, I assume you are OK with this patch, the default is now off.
Of course
Let me
On Thu, Feb 27, 2014 at 1:00 PM, Joe Perches j...@perches.com wrote:
Of course
The change has applied and pushed.
Chris
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at
On Thu, 2014-02-27 at 12:55 -0800, Christopher Li wrote:
On Thu, Feb 27, 2014 at 12:39 PM, Joe Perches j...@perches.com wrote:
Maybe the evaluate.c size = bits_in_char; assignment
if (size == 1 is_bool_type(type)) {
- warning(expr-pos, expression using sizeof
On 02/26/2014 08:26 PM, Ben Pfaff wrote:
>
>> Because sizeof(_Bool) is a little bit special compare to sizeof(long).
>> In the case of long, all sizeof(long) * 8 bits are use in the actual value.
>> But for the _Bool, only the 1 bit is used in the 8 bits size. In other words,
>> the _Bool has a
On Wed, Feb 26, 2014 at 08:19:57PM -0800, H. Peter Anvin wrote:
> On 02/26/2014 08:00 PM, Ben Pfaff wrote:
> >
> > The commit *relaxed* sparse behavior: because previously sizeof(bool)
> > was an error. I'm not in favor of any diagnostic at all for
> > sizeof(bool), but my recollection is that a
On 02/26/2014 08:00 PM, Ben Pfaff wrote:
>
> The commit *relaxed* sparse behavior: because previously sizeof(bool)
> was an error. I'm not in favor of any diagnostic at all for
> sizeof(bool), but my recollection is that a sparse maintainer wanted it
> to yield one.
>
Still not clear as to
On Wed, Feb 26, 2014 at 07:38:46PM -0800, Joe Perches wrote:
> (adding Ben Pfaff and Christopher Li)
>
> On Wed, 2014-02-26 at 19:29 -0800, H. Peter Anvin wrote:
> > On 02/26/2014 06:58 PM, Josh Triplett wrote:
> > > On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
> > >> Allow an
sizeof(_Bool), like for many other types, is ABI-dependent, but that doesn't
mean it is illegitimate.
I don't think C99 says that it is invalid (which means C99 doesn't permit is to
be a packed bitmap.)
On February 26, 2014 7:38:46 PM PST, Joe Perches wrote:
>(adding Ben Pfaff and Christopher
(adding Ben Pfaff and Christopher Li)
On Wed, 2014-02-26 at 19:29 -0800, H. Peter Anvin wrote:
> On 02/26/2014 06:58 PM, Josh Triplett wrote:
> > On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
> >> Allow an override to emit or not the sizeof(bool) warning
> >> Add a description to
On 02/26/2014 06:58 PM, Josh Triplett wrote:
> On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
>> Allow an override to emit or not the sizeof(bool) warning
>> Add a description to the manpage.
>>
>> Signed-off-by: Joe Perches
>
> Reviewed-by: Josh Triplett
>
I have to admit that
On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
> Allow an override to emit or not the sizeof(bool) warning
> Add a description to the manpage.
>
> Signed-off-by: Joe Perches
Reviewed-by: Josh Triplett
> evaluate.c | 3 ++-
> lib.c | 2 ++
> lib.h | 1 +
> sparse.1 |
On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
Allow an override to emit or not the sizeof(bool) warning
Add a description to the manpage.
Signed-off-by: Joe Perches j...@perches.com
Reviewed-by: Josh Triplett j...@joshtriplett.org
evaluate.c | 3 ++-
lib.c | 2 ++
On 02/26/2014 06:58 PM, Josh Triplett wrote:
On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
Allow an override to emit or not the sizeof(bool) warning
Add a description to the manpage.
Signed-off-by: Joe Perches j...@perches.com
Reviewed-by: Josh Triplett j...@joshtriplett.org
(adding Ben Pfaff and Christopher Li)
On Wed, 2014-02-26 at 19:29 -0800, H. Peter Anvin wrote:
On 02/26/2014 06:58 PM, Josh Triplett wrote:
On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
Allow an override to emit or not the sizeof(bool) warning
Add a description to the
sizeof(_Bool), like for many other types, is ABI-dependent, but that doesn't
mean it is illegitimate.
I don't think C99 says that it is invalid (which means C99 doesn't permit is to
be a packed bitmap.)
On February 26, 2014 7:38:46 PM PST, Joe Perches j...@perches.com wrote:
(adding Ben Pfaff
On Wed, Feb 26, 2014 at 07:38:46PM -0800, Joe Perches wrote:
(adding Ben Pfaff and Christopher Li)
On Wed, 2014-02-26 at 19:29 -0800, H. Peter Anvin wrote:
On 02/26/2014 06:58 PM, Josh Triplett wrote:
On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
Allow an override to
On 02/26/2014 08:00 PM, Ben Pfaff wrote:
The commit *relaxed* sparse behavior: because previously sizeof(bool)
was an error. I'm not in favor of any diagnostic at all for
sizeof(bool), but my recollection is that a sparse maintainer wanted it
to yield one.
Still not clear as to why.
On Wed, Feb 26, 2014 at 08:19:57PM -0800, H. Peter Anvin wrote:
On 02/26/2014 08:00 PM, Ben Pfaff wrote:
The commit *relaxed* sparse behavior: because previously sizeof(bool)
was an error. I'm not in favor of any diagnostic at all for
sizeof(bool), but my recollection is that a sparse
On 02/26/2014 08:26 PM, Ben Pfaff wrote:
Because sizeof(_Bool) is a little bit special compare to sizeof(long).
In the case of long, all sizeof(long) * 8 bits are use in the actual value.
But for the _Bool, only the 1 bit is used in the 8 bits size. In other words,
the _Bool has a special
50 matches
Mail list logo