Commit 975dff72 authored by Rusty Russell's avatar Rusty Russell

configurator: more robust test for HAVE_NESTED_FUNCTIONS

Thanks to Andreas Schlick, we have a nicer test for when gcc warns about
trampolines (gcc 4.6's -Wtrampolines).  This works at any optimization level,
and means when that warning is enabled we recognize that we shouldn't allow
nested functions.
parent 39dc9e46
......@@ -111,12 +111,12 @@ static struct test tests[] = {
" return mmap(0, 65536, PROT_READ, MAP_SHARED, fd, 0);\n"
"}" },
{ "HAVE_NESTED_FUNCTIONS", DEFINES_FUNC, NULL,
"static int func(int val) {\n"
"void (*func(int val))(int);\n"
"void (*func(int val))(int) {\n"
" auto void add(int val2);\n"
" void add(int val2) { val += val2; }\n"
" add(7);\n"
" return val;\n"
"}" },
" return add;\n"
"}\n" },
{ "HAVE_STATEMENT_EXPR", INSIDE_MAIN, NULL,
"return ({ int x = argc; x == argc ? 0 : 1; });" },
{ "HAVE_TYPEOF", INSIDE_MAIN, NULL,
......
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