@@ -52,8 +52,11 @@ NB: the build flags are shared with the run command too:
52
52
53
53
-d <flag>[=<value>], -define <flag>[=<value>]
54
54
Define the provided flag.
55
- If value is not provided, it is assumed to be set to `true`.
56
- `value` should be `1` or `0` to indicate `true` and `false` respectively otherwise.
55
+ If `value` is not provided, it is assumed to be set to `true`.
56
+ `value` can be any pure literal like `32` (i64),`34.98` (f64), `false` (bool),
57
+ `v` (char) or `"V rocks"` (string). In V code you can use `value := $d('<flag>', <default value>)`
58
+ to retrieve the value assigned to `<flag>`.
59
+ If no flag identifier (or value) is assigned, `$d()` will return the passed `<default value>`.
57
60
58
61
-g
59
62
Compile the executable in debug mode, allowing code to be debugged more easily.
@@ -92,7 +95,7 @@ NB: the build flags are shared with the run command too:
92
95
Compile the executable in production mode, where most optimizations are enabled.
93
96
Note that most V warnings turn to errors, if you pass -prod, so you will have
94
97
to fix them first.
95
-
98
+
96
99
-no-bounds-checking
97
100
Programs compiled with this option, will do no runtime checking of array access operations.
98
101
Note that the performance impact of the bounds checking is usually below 3%, so in most
@@ -107,7 +110,7 @@ NB: the build flags are shared with the run command too:
107
110
b) how much *nanoseconds in total* it took
108
111
c) an average for each function (i.e. (b) / (a) )
109
112
d) the function name
110
-
113
+
111
114
NB: you can also combine this command with `run` command.
112
115
For example - `v -prof prof.txt run main.v`
113
116
@@ -176,7 +179,7 @@ NB: the build flags are shared with the run command too:
176
179
Tell V to be quieter, and to not show many otherwise helpful messages, that only get in your
177
180
way once you have read them a few dozen times. One example is the notice message, usually
178
181
shown for `v -prod run file.v`, that says that -prod should not be used with run .
179
- Note, this option *does not affect* errors/warnings/notices, just messages that V prints in
182
+ Note, this option *does not affect* errors/warnings/notices, just messages that V prints in
180
183
order to be more user friendly, in common situations, that are error prone for new users, and
181
184
that just needlessly take vertical space, once you are well aware of them.
182
185
@@ -248,4 +251,4 @@ For Native-specific build flags, use `v help build-native`.
248
251
For WebAssembly-specific build flags, use `v help build-wasm`.
249
252
250
253
See also:
251
- `v help run` for documentation regarding `v run`.
254
+ `v help run` for documentation regarding `v run`.
0 commit comments