Commit b2be425e authored by Cody P Schafer's avatar Cody P Schafer Committed by Rusty Russell

configurator: avoid potential unused parameter warnings hosing our config.h

Signed-off-by: default avatarCody P Schafer <dev@codyps.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 7c077923
......@@ -63,7 +63,7 @@ struct test {
static struct test tests[] = {
{ "HAVE_32BIT_OFF_T", DEFINES_EVERYTHING|EXECUTE, NULL, NULL,
"#include <sys/types.h>\n"
"int main(int argc, char *argv[]) {\n"
"int main(void) {\n"
" return sizeof(off_t) == 4 ? 0 : 1;\n"
"}\n" },
{ "HAVE_ALIGNOF", INSIDE_MAIN, NULL, NULL,
......@@ -90,7 +90,7 @@ static struct test tests[] = {
"#include <stdlib.h>\n"
"static void __attribute__((noreturn)) func(int x) { exit(x); }" },
{ "HAVE_ATTRIBUTE_PRINTF", DEFINES_FUNC, NULL, NULL,
"static void __attribute__((format(__printf__, 1, 2))) func(const char *fmt, ...) { }" },
"static void __attribute__((format(__printf__, 1, 2))) func(const char *fmt, ...) { (void)fmt; }" },
{ "HAVE_ATTRIBUTE_UNUSED", OUTSIDE_MAIN, NULL, NULL,
"static int __attribute__((unused)) func(int x) { return x; }" },
{ "HAVE_ATTRIBUTE_USED", OUTSIDE_MAIN, NULL, NULL,
......@@ -191,7 +191,7 @@ static struct test tests[] = {
"HAVE_32BIT_OFF_T", NULL,
"#define _FILE_OFFSET_BITS 64\n"
"#include <sys/types.h>\n"
"int main(int argc, char *argv[]) {\n"
"int main(void) {\n"
" return sizeof(off_t) == 8 ? 0 : 1;\n"
"}\n" },
{ "HAVE_FOR_LOOP_DECLARATION", INSIDE_MAIN, NULL, NULL,
......@@ -277,7 +277,8 @@ static struct test tests[] = {
" return nest(base, i-1);\n"
"}\n"
"int main(int argc, char *argv[]) {\n"
" return (nest(&argc, argc) > 0) ? 0 : 1\n;"
" (void)argv;\n"
" return (nest(&argc, argc) > 0) ? 0 : 1;\n"
"}\n" },
{ "HAVE_STATEMENT_EXPR", INSIDE_MAIN, NULL, NULL,
"return ({ int x = argc; x == argc ? 0 : 1; });" },
......@@ -290,6 +291,7 @@ static struct test tests[] = {
{ "HAVE_UNALIGNED_ACCESS", DEFINES_EVERYTHING|EXECUTE, NULL, NULL,
"#include <string.h>\n"
"int main(int argc, char *argv[]) {\n"
" (void)argc;\n"
" char pad[sizeof(int *) * 1];\n"
" strncpy(pad, argv[0], sizeof(pad));\n"
" int *x = (int *)pad, *y = (int *)(pad + 1);\n"
......@@ -403,7 +405,10 @@ static struct test *find_test(const char *name)
}
#define PRE_BOILERPLATE "/* Test program generated by configurator. */\n"
#define MAIN_START_BOILERPLATE "int main(int argc, char *argv[]) {\n"
#define MAIN_START_BOILERPLATE \
"int main(int argc, char *argv[]) {\n" \
" (void)argc;\n" \
" (void)argv;\n"
#define USE_FUNC_BOILERPLATE "(void)func;\n"
#define MAIN_BODY_BOILERPLATE "return 0;\n"
#define MAIN_END_BOILERPLATE "}\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment