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

Allow specifying additional compiler flags via [@@@ocaml.flags] #6483

Closed
vicuna opened this Issue Jul 11, 2014 · 6 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Jul 11, 2014

Original bug ID: 6483
Reporter: @whitequark
Status: closed (set by @alainfrisch on 2014-07-22T16:22:31Z)
Resolution: not a bug
Priority: normal
Severity: feature
Target version: 4.02.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #6202
Monitored by: @Drup @hcarty

Bug description

Subject explains it all. It would be useful for cleanly setting flags like -rectypes on a per-file basis independent of buildsystem, and is also a nice companion to [@@@ocaml.warning].

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jul 11, 2014

Comment author: @dbuenzli

I hope this is a joke.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jul 11, 2014

Comment author: @whitequark

We've been discussing such a feature on IRC (in seriousness, if you need to know), and I thought it would be worth having reasons to/against weighed on the bugtracker.

I can see it being useful in some cases.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jul 16, 2014

Comment author: @damiendoligez

Would these take precedence over OCAMLPARAM? I can see arguments against in either case.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jul 16, 2014

Comment author: @whitequark

I imagine such a feature taking precedence over any environment-based setting.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jul 16, 2014

Comment author: @damiendoligez

I imagine such a feature taking precedence over any environment-based setting.

Given the intended use of OCAMLPARAM, that would be really bad. And indeed i'd like to know what [@@@ocaml.warning] does in this respect.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jul 22, 2014

Comment author: @whitequark

I've thought more on this issue. Here is the list of flags that at all make sense to specify in the file:

-ppx, -[un]safe-string

Options like -compact aren't supported by ocamlc. -w is covered by [@@@ocaml.warning]. Anything else either clearly belongs to buildsystem (like -noassert, -labels, etc) or doesn't make sense to use for single files (like -rectypes, -short-paths, -labels, etc).

-ppx can be solved with a ppx that reads annotations.

-safe-string is probably not important enough.

So I think this issue isn't worth the hassle and can be closed.

@vicuna vicuna closed this Jul 22, 2014

@vicuna vicuna added this to the 4.02.0 milestone Mar 14, 2019

@vicuna vicuna added the feature-wish label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.