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 ',' at the start of OCAMLRUNPARAM #9634

Merged
merged 3 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Working version
(Nicolás Ojeda Bär, review by Stephen Dolan, Gabriel Scherer, Mark Shinwell,
and Xavier Leroy)

- #9634: Allow initial and repeated commas in `OCAMLRUNPARAM`.
(Nicolás Ojeda Bär, review by Gabriel Scherer)

### Code generation and optimizations:

- #9441: Add RISC-V RV64G native-code backend.
Expand Down
2 changes: 2 additions & 0 deletions manual/manual/cmds/runtime.etex
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ The following environment variables are also consulted:
(If "OCAMLRUNPARAM" is not set, "CAMLRUNPARAM" will be used instead.)
This variable must be a sequence of parameter specifications separated
by commas.
For convenience, commas at the beginning of the variable are ignored,
and multiple runs of commas are interpreted as a single one.
A parameter specification is an option letter followed by an "="
sign, a decimal number (or an hexadecimal number prefixed by "0x"),
and an optional multiplier. The options are documented below;
Expand Down
1 change: 1 addition & 0 deletions runtime/startup_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void caml_parse_ocamlrunparam(void)
case 'v': scanmult (opt, &caml_verb_gc); break;
case 'w': scanmult (opt, &caml_init_major_window); break;
case 'W': scanmult (opt, &caml_runtime_warnings); break;
case ',': continue;
}
while (*opt != '\0'){
if (*opt++ == ',') break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this while loop anymore, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if I understand correctly, the scanmult call does not update opt, so we still need to skip over the =... part read by it before going on to the next item (which is what the while loop is doing).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I had misunderstood indeed. I thought that we were only skipping commas here.

Expand Down