Skip to content

Commit dc2f7eb

Browse files
committed
attrconst for tests
Fixes build warnings when running with higher optimization than -O0 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent 36698d1 commit dc2f7eb

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

ccan/array_size/test/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static int array2_size = ARRAY_SIZE(array2);
1616
static int array3_size = ARRAY_SIZE(array3);
1717
static int array4_size = ARRAY_SIZE(array4);
1818

19-
int main(int argc, char *argv[])
19+
int __attribute__((const)) main(int argc, char *argv[])
2020
{
2121
(void)argc;
2222
(void)argv;

ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <ccan/build_assert/build_assert.h>
22
#include <ccan/tap/tap.h>
33

4-
int main(int argc, char *argv[])
4+
int __attribute__((const)) main(int argc, char *argv[])
55
{
66
(void)argc;
77
(void)argv;

ccan/check_type/test/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <ccan/check_type/check_type.h>
22
#include <ccan/tap/tap.h>
33

4-
int main(int argc, char *argv[])
4+
int __attribute__((const)) main(int argc, char *argv[])
55
{
66
int x = 0, y = 0;
77

ccan/container_of/test/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct foo {
66
char b;
77
};
88

9-
int main(int argc, char *argv[])
9+
int __attribute__((const)) main(int argc, char *argv[])
1010
{
1111
struct foo foo = { .a = 1, .b = 2 };
1212
int *intp = &foo.a;

ccan/short_types/test/run-endian.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <stdlib.h>
55
#include <err.h>
66

7-
int main(void)
7+
int __attribute__((const)) main(void)
88
{
99
plan_tests(6);
1010

ccan/short_types/test/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <stdlib.h>
44
#include <err.h>
55

6-
int main(void)
6+
int __attribute__((const)) main(void)
77
{
88
plan_tests(16);
99

core/test/run-mem_region_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static void add_mem_node(uint64_t start, uint64_t len)
105105
free(name);
106106
}
107107

108-
void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
108+
void __attrconst add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
109109
{
110110
}
111111

core/test/run-mem_region_release_unused.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void add_mem_node(uint64_t start, uint64_t len)
9999
free(name);
100100
}
101101

102-
void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
102+
void __attrconst add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
103103
{
104104
}
105105

core/test/run-mem_region_release_unused_noalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void add_mem_node(uint64_t start, uint64_t len)
9999
free(name);
100100
}
101101

102-
void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
102+
void __attrconst add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
103103
{
104104
}
105105

0 commit comments

Comments
 (0)