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

Dune environment variables suppressing compiler warnings #244

Open
MartyO256 opened this issue May 25, 2021 · 1 comment
Open

Dune environment variables suppressing compiler warnings #244

MartyO256 opened this issue May 25, 2021 · 1 comment
Labels
A | misc miscellaneous issues B | refactor changing the implementation of existing features

Comments

@MartyO256
Copy link
Member

The following dune environment variables are set in the core, harpoon and optparser packages.
These globally disable compilation warnings such as unused variables.
However, what I find alarming is that warnings about not exhaustive pattern-matching are also suppressed.
This explains why there are not easily reproducible pattern-matching errors thrown in Harpoon sessions.

Beluga/src/core/dune

Lines 7 to 9 in 3db1ffd

(env
(dev
(flags (:standard -w Azep-44-48-50-58 -warn-error Ap-37-48-50-60))))

(env
(dev
(flags (:standard -w Azep-44-48-50-58 -warn-error Ap-37-48-50-60))))

(env
(dev
(flags (:standard -w A-42-44 -warn-error A-42-44))))

Where not exhaustive pattern-matching is intended as in the following, then warnings should be explicitly suppressed with macros like [@warning "-8"] instead of being toggled off globally.

Beluga/src/core/error.ml

Lines 116 to 122 in 3db1ffd

begin fun (Sys_error msg) ->
print
begin fun ppf ->
Format.fprintf ppf "System error: %s"
msg
end
end;

Fixing this issue won't be easy as it affects most files.

@Ailrun
Copy link
Member

Ailrun commented May 25, 2021

There's really a lot of non-exhaustive pattern matches, so it's hard to enable the warning. An affordable solution would be handling them one-by-one (though it will still take long time)

@MartyO256 MartyO256 added B | refactor changing the implementation of existing features A | misc miscellaneous issues labels Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A | misc miscellaneous issues B | refactor changing the implementation of existing features
Projects
None yet
Development

No branches or pull requests

2 participants