mirror of
https://github.com/Dasharo/skiboot.git
synced 2026-03-06 14:50:44 -08:00
10d50007fb
sync to upstream ccan.git commit ca7c5a9e04f3 ("ccan: make tal_dump()
format more regular.").
The recipe used to sync upstream is:
$ cd ccan
$ ./tools/create-ccan-tree -b make tmp \
array_size check_type container_of heap \
short_types build_assert endian list str
$ # replace directories in skiboot/ccan/ with those in tmp/ccan/
$ cd ../skiboot
$ patch -p1 < ccan/skiboot.patch
This also adds a README.skiboot to help with future updates.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
25 lines
479 B
C
25 lines
479 B
C
#include <ccan/array_size/array_size.h>
|
|
#include <stdlib.h>
|
|
|
|
struct foo {
|
|
unsigned int a, b;
|
|
};
|
|
|
|
int check_parameter(const struct foo *array);
|
|
int check_parameter(const struct foo *array)
|
|
{
|
|
#ifdef FAIL
|
|
return (ARRAY_SIZE(array) == 4);
|
|
#if !HAVE_TYPEOF || !HAVE_BUILTIN_TYPES_COMPATIBLE_P
|
|
#error "Unfortunately we don't fail if _array_size_chk is a noop."
|
|
#endif
|
|
#else
|
|
return sizeof(array) == 4 * sizeof(struct foo);
|
|
#endif
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
return check_parameter(NULL);
|
|
}
|