Skip to content

Commit

Permalink
attrconst for tests
Browse files Browse the repository at this point in the history
Fixes build warnings when running with higher optimization than -O0

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
stewartsmith committed Jul 19, 2017
1 parent 36698d1 commit dc2f7eb
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ccan/array_size/test/run.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c
@@ -1,7 +1,7 @@
#include <ccan/build_assert/build_assert.h>
#include <ccan/tap/tap.h>

int main(int argc, char *argv[])
int __attribute__((const)) main(int argc, char *argv[])
{
(void)argc;
(void)argv;
Expand Down
2 changes: 1 addition & 1 deletion ccan/check_type/test/run.c
@@ -1,7 +1,7 @@
#include <ccan/check_type/check_type.h>
#include <ccan/tap/tap.h>

int main(int argc, char *argv[])
int __attribute__((const)) main(int argc, char *argv[])
{
int x = 0, y = 0;

Expand Down
2 changes: 1 addition & 1 deletion ccan/container_of/test/run.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ccan/short_types/test/run-endian.c
Expand Up @@ -4,7 +4,7 @@
#include <stdlib.h>
#include <err.h>

int main(void)
int __attribute__((const)) main(void)
{
plan_tests(6);

Expand Down
2 changes: 1 addition & 1 deletion ccan/short_types/test/run.c
Expand Up @@ -3,7 +3,7 @@
#include <stdlib.h>
#include <err.h>

int main(void)
int __attribute__((const)) main(void)
{
plan_tests(16);

Expand Down
2 changes: 1 addition & 1 deletion core/test/run-mem_region_init.c
Expand Up @@ -105,7 +105,7 @@ static void add_mem_node(uint64_t start, uint64_t len)
free(name);
}

void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
void __attrconst add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
{
}

Expand Down
2 changes: 1 addition & 1 deletion core/test/run-mem_region_release_unused.c
Expand Up @@ -99,7 +99,7 @@ static void add_mem_node(uint64_t start, uint64_t len)
free(name);
}

void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
void __attrconst add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
{
}

Expand Down
2 changes: 1 addition & 1 deletion core/test/run-mem_region_release_unused_noalloc.c
Expand Up @@ -99,7 +99,7 @@ static void add_mem_node(uint64_t start, uint64_t len)
free(name);
}

void add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
void __attrconst add_chip_dev_associativity(struct dt_node *dev __attribute__((unused)))
{
}

Expand Down

0 comments on commit dc2f7eb

Please sign in to comment.