open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.14k stars 859 forks source link

master: false positive in configure for C11 _Static_assert with GCC 4.4.7 #5189

Closed benmenadue closed 6 years ago

benmenadue commented 6 years ago

Thank you for taking the time to submit an issue!

Background information

What version of Open MPI are you using? (e.g., v1.10.3, v2.1.0, git branch name and hash, etc.)

master@385d91b

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

git clone

Please describe the system on which you are running


Details of the problem

This test erroneously concludes that adding the -c11 flag makes the compiler support _Static_assert. GCC is producing a warning about the unrecognised option, but still successfully compiles the file because it treats _Static_assert(...) as a implicitly-defined function. If it were to try linking the file it would probably fail with an undefined symbol.

configure:15649: checking if gcc -c11 supports C11 _Static_assert
configure:15665: gcc -c -DNDEBUG -g -march=native -c11  conftest.c >&5
gcc: unrecognized option '-c11'
configure:15665: $? = 0
configure:15680: result: yes

This is using

> gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
jsquyres commented 6 years ago

Fixed by #5191.