-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: add _Generic selection test to autoconf #146
Conversation
configure will fail with a note if the C compiler does not support the _Generic selection introduced in C11 - https://en.cppreference.com/w/c/language/generic
@underwoo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will wait for the merge of upstream PR before testing and merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and it did not work as expected. As a control case, I commented out the module load gcc
in the GFDL-WS site file, then did a regular compilation. ./configure
worked and the compile failed with the telltale syntax errors:
create_xgrid.c(1311): error: expected an expression
if(fabs(determ) < EPSLN30) {
Then I reran with these changes, starting with a fresh clean and autoreconf -i. ./configure now barks with:
./configure: line 4675: GX_C__GENERIC: command not found
./configure: line 4676: test: =: unary operator expected
but still passes and create the Makefiles.
@ceblanton , @underwoo |
I just noticed I forgot to add the gx_c__generic.m4 file to the commit. I'll get that added, and push. |
This is needed to test for the _Generic C11-style generic selection.
@ngs333 @ceblanton I pushed the |
I verified the failure and appropriate message for the case when the compiler is not compliant. |
configure will fail with a note if the C compiler does not support the _Generic selection introduced in C11 - https://en.cppreference.com/w/c/language/generic
Fixes #102