From dc2f7ebfdf889ea97857fa32405040ea845505bf Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Tue, 18 Jul 2017 13:44:42 +1000 Subject: attrconst for tests Fixes build warnings when running with higher optimization than -O0 Signed-off-by: Stewart Smith --- ccan/array_size/test/run.c | 2 +- ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c | 2 +- ccan/check_type/test/run.c | 2 +- ccan/container_of/test/run.c | 2 +- ccan/short_types/test/run-endian.c | 2 +- ccan/short_types/test/run.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ccan') diff --git a/ccan/array_size/test/run.c b/ccan/array_size/test/run.c index 284e315..a17f045 100644 --- a/ccan/array_size/test/run.c +++ b/ccan/array_size/test/run.c @@ -16,7 +16,7 @@ static int array2_size = ARRAY_SIZE(array2); static int array3_size = ARRAY_SIZE(array3); static int array4_size = ARRAY_SIZE(array4); -int main(int argc, char *argv[]) +int __attribute__((const)) main(int argc, char *argv[]) { (void)argc; (void)argv; diff --git a/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c b/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c index 55e6f3c..77bf94c 100644 --- a/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c +++ b/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c @@ -1,7 +1,7 @@ #include #include -int main(int argc, char *argv[]) +int __attribute__((const)) main(int argc, char *argv[]) { (void)argc; (void)argv; diff --git a/ccan/check_type/test/run.c b/ccan/check_type/test/run.c index 767c9fd..be0e246 100644 --- a/ccan/check_type/test/run.c +++ b/ccan/check_type/test/run.c @@ -1,7 +1,7 @@ #include #include -int main(int argc, char *argv[]) +int __attribute__((const)) main(int argc, char *argv[]) { int x = 0, y = 0; diff --git a/ccan/container_of/test/run.c b/ccan/container_of/test/run.c index 9e51b0d..2bd6947 100644 --- a/ccan/container_of/test/run.c +++ b/ccan/container_of/test/run.c @@ -6,7 +6,7 @@ struct foo { char b; }; -int main(int argc, char *argv[]) +int __attribute__((const)) main(int argc, char *argv[]) { struct foo foo = { .a = 1, .b = 2 }; int *intp = &foo.a; diff --git a/ccan/short_types/test/run-endian.c b/ccan/short_types/test/run-endian.c index 108e3ab..d8953a3 100644 --- a/ccan/short_types/test/run-endian.c +++ b/ccan/short_types/test/run-endian.c @@ -4,7 +4,7 @@ #include #include -int main(void) +int __attribute__((const)) main(void) { plan_tests(6); diff --git a/ccan/short_types/test/run.c b/ccan/short_types/test/run.c index 2bff4b7..ac8b31b 100644 --- a/ccan/short_types/test/run.c +++ b/ccan/short_types/test/run.c @@ -3,7 +3,7 @@ #include #include -int main(void) +int __attribute__((const)) main(void) { plan_tests(16); -- cgit v1.1