Re: [greybus-dev] [PATCH] staging: greybus: fixed the coding style, labels should not be indented.

From
Joe Perches <joe@perches.com>
Date
2021-06-04 08:26:35
Also in
lkml
Reply to
David Laight, 2021-06-04
On Fri, 2021-06-04 at 08:13 +0000, David Laight wrote:
From: Alex Elder
quoted
Sent: 03 June 2021 22:55
...
quoted
Not necessarily, sizeof(bool) is implementation defined.
And I thought you didn't think the size of the structure
was very important...
It is 'implementation defined' but will be 32 bits on everything
except an old 32bit ARM ABI.
Really? (x86-64)

$ gcc -x c -
#include <stdio.h>
#include <stdlib.h>

struct foo {
	_Bool b;
};

int main(int argc, char **argv)
{
	printf("sizeof _Bool: %zu\n", sizeof(_Bool));
	printf("sizeof struct foo: %zu\n", sizeof(struct foo));
	return 0;
}
$ ./a.out
sizeof _Bool: 1
sizeof struct foo: 1

Thread (15 messages) 15 messages, 6 authors, last reply 2021-06-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help