Shouldn't main's generated args be const? #764
Replies: 4 comments
-
(At least in C, argv is mutable and can be used for scratchpad memory.) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'd say it's an accident. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks! Good point, this was an oversight. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Fixed: 32a72fc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the
args
generated by cppfront in main isn't const (see here) which seems to create an inconsistency within the language.For example, the following will compile because
args
isn't const:The seemingly identical following code will fail to compile, though, because
args
will be const hereIs this an intentional design decision/special case for main? As far as my understanding goes, it shouldn't be mutable as it's an
in
parameter, but maybe I'm missing something.Beta Was this translation helpful? Give feedback.
All reactions