Mentions légales du service

Skip to content

on clang 12 from Apple's Xcode 12, checking if globals are prefixed by underscore test fails

Imported issue: Initially reported by Dmitrii Pasechnik in https://gforge.inria.fr/tracker/?group_id=135&aid=21856


the reason is that by default the compiler has -Werror on, so no wonder.

How about actually having underscore_test() defined as a C function?

configure:13260: checking if globals are prefixed by underscore

configure:13286: gcc -march=native -g -O3 -fPIC -c conftes1.c >&5 && gcc -march=native -g -O3 -fPIC -c conftes2.s >&5 && gcc -march=native -g -O3 -fPIC -L/Users/dima/software/sagetrac-mirror/local/lib

-Wl,-rpath,/Users/dima/software/sagetrac-mirror/local/lib conftes1.o conftes2.o >&5

conftes1.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]

main () { underscore_test(); }

^

conftes1.c:4:11: error: implicit declaration of function 'underscore_test' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

main () { underscore_test(); }

      ^

1 warning and 1 error generated.

configure:13289: $? = 1

configure:13286: gcc -march=native -g -O3 -fPIC -c conftes1.c >&5 && gcc -march=native -g -O3 -fPIC -c conftes2.s >&5 && gcc -march=native -g -O3 -fPIC -L/Users/dima/software/sagetrac-mirror/local/lib

-Wl,-rpath,/Users/dima/software/sagetrac-mirror/local/lib conftes1.o conftes2.o >&5

conftes1.c:4:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]

main () { underscore_test(); }

^

conftes1.c:4:11: error: implicit declaration of function 'underscore_test' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

main () { underscore_test(); }

      ^

1 warning and 1 error generated.

configure:13289: $? = 1

configure:13307: error: Test program links neither with nor without underscore.