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

-std=gnu99 causes annoying warnings #7377

vicuna opened this issue Sep 27, 2016 · 2 comments

-std=gnu99 causes annoying warnings #7377

vicuna opened this issue Sep 27, 2016 · 2 comments


Copy link

@vicuna vicuna commented Sep 27, 2016

Original bug ID: 7377
Reporter: @ygrek
Status: resolved (set by @xavierleroy on 2016-12-05T08:41:31Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.03.0
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche

Bug description

Problem 1

When compiling c++ code via ocamlc (passing -ccopt -xc++ to tell gcc treat .c file as c++ code) gcc will complain that gnu99 applies to C code only

Problem 2

With gcc 6 (for example) default C standard is gnu11 and -std=gnu99 becomes too pessimistic and may cause code to fail (theory - didn't observe this).

One way to fix this would be to remove this option from native_c_compiler and require users to supply a C99 supporting compiler at configure time explicitly if needed (with -cc "gcc -std=gnu99") - this will solve problem 1 for us because we use newer gcc anyway.

Copy link

@vicuna vicuna commented Oct 27, 2016

Comment author: @damiendoligez

I think the solution is to remove the -std=gnu99 option when using gcc 5 and later (which default to gnu11).

I've created #876 ( #876 ) against trunk because I think this is a bit too risky to fix just before the release.

Copy link

@vicuna vicuna commented Dec 5, 2016

Comment author: @xavierleroy

Fixed in commit 4c03ef7 as part of #876.

@vicuna vicuna closed this as completed Dec 5, 2016
@vicuna vicuna added this to the 4.05.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant