-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
fix Issue 17045 - deprecate main(char[][]) argument check #6387
Conversation
088f736
to
19e36e8
Compare
Looks like I need to deprecate the old way. |
19e36e8
to
c3f18d0
Compare
9422802
to
97254f5
Compare
97254f5
to
f067707
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, I didn't mind that I had the option to change the input... what is bad about this?
if (t.ty == Tarray && t.nextOf().ty == Tarray && t.nextOf().nextOf().ty == Tchar) | ||
deprecation("use main(string[]) instead of main(char[][])"); | ||
else | ||
argerr = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not covered
if (!tf.nextOf()) | ||
error("must return int or void"); | ||
else if (tf.nextOf().ty != Tint32 && tf.nextOf().ty != Tvoid) | ||
error("must return int or void, not %s", tf.nextOf().toChars()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not covered
|
We could move the matter as a bug in the documentation.
That is interesting. How? Where?
I would agree for a general function, but |
cc @MartinNowak to weigh in on the deprecation process |
main's arguments can come from anywhere, like a string from the operating system. Mutating strings like that is just not a good idea. There many be multithreading issues. I don't see a reasonable use case for mutating them. Making the mutable is an additional constraint on the caller - and for what purpose? |
Replaced with #6399 |
It was a leftover from D1 daze, the check is now proper D2.