Skip to content
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

Trying to set c_std to 18 and got an error #5539

Closed
squidfarts opened this issue Jun 21, 2019 · 9 comments · Fixed by #5560
Closed

Trying to set c_std to 18 and got an error #5539

squidfarts opened this issue Jun 21, 2019 · 9 comments · Fixed by #5560

Comments

@squidfarts
Copy link

squidfarts commented Jun 21, 2019

I am trying to set ‘c_std’ to version 18 and it printed an error about that version not being valid. The document on built-in options states that it is.

However the value “c17” is working.

Would this be fixed at some point?

@scivision
Copy link
Member

scivision commented Jun 25, 2019

Hi @squidfarts I get the same error with Meson v0.50. However, it has been fixed [EDIT: for gcc, but not yet for Clang] with Meson ≥ v0.51
Try upgrading to the latest Meson release and please reopen this issue if it's still a problem. Thanks!

@scivision
Copy link
Member

Here was the MWE:

meson.build

project('C18 Standard', 'c', default_options: ['c_std=c18'])

exe = executable('C18program', 'main.c')
test('C18program', exe)

main.c

int main(void){ return 0; }

@squidfarts
Copy link
Author

squidfarts commented Jun 25, 2019

But why do I get this?

Michaels-MacBook-Pro:~ shnitzel$ cd Developer/templates/c/
.DS_Store example.zip executable.zip project.zip
Michaels-MacBook-Pro:~ shnitzel$ cd Developer/templates/c/example/
Michaels-MacBook-Pro:example shnitzel$ meson setup build
The Meson build system
Version: 0.51.0
Source dir: /Users/shnitzel/Developer/templates/c/example
Build dir: /Users/shnitzel/Developer/templates/c/example/build
Build type: native build
Project name: c_example
Project version: 0.1.0
C compiler for the build machine: cc (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")

meson.build:39:0: ERROR: Value "c18" for combo option is not one of the choices. Possible choices are: "none", "c89", "c99", "c11", "c17", "gnu89", "gnu99", "gnu11", "gnu17".

A full log can be found at /Users/shnitzel/Developer/templates/c/example/build/meson-logs/meson-log.txt
Michaels-MacBook-Pro:example shnitzel$

I used this:
https://github.com/squidfarts/c-example.git

@scivision scivision reopened this Jun 26, 2019
@scivision scivision removed this from the 0.51.0 milestone Jun 26, 2019
@scivision
Copy link
Member

OK! Sorry about that I should have asked more about the setup. Thanks!

@scivision
Copy link
Member

scivision commented Jun 26, 2019

Yes, this initially appears to be particular to Clang compiler (not a compiler bug, just doesn't happen with GCC. It was a problem with GCC on Meson 0.50 but not 0.51, while Clang is still broken with 0.51 and master branch.). With Windows and Clang 8.0 and the MWE above I get error:

C compiler for the build machine: clang (clang 8.0.0 "clang version 8.0.0 (tags/RELEASE_800/final)")
meson.build:1:0: ERROR: Value "c18" for combo option is not one of the choices. Possible choices are: > "none", "c89", "c99", "c11", "c17", "gnu89", "gnu99", "gnu11", "gnu17".

@scivision
Copy link
Member

@squidfarts I believe #5560 will solve this issue. Thanks again.

@squidfarts
Copy link
Author

Your welcome 🙂

@squidfarts
Copy link
Author

squidfarts commented Jun 30, 2019

Sorry to bother you again but the c_std=18 is still showing an error. The same one. I tried the cstd18_bug branch.

@scivision
Copy link
Member

scivision commented Jul 2, 2019

OK so you have AppleClang 10.0.1 there were some suggested changes to #5560 to streamline logic. Maybe I accidentally didn't cover this case with the present logic. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants