Recently I noticed a question where a long time user edit the void main()
in the OP's code to int main()
. I left a comment asking how did he know that is not using void main()
? I got a reply back from the editor
[...]It would be really bad teaching to let it pass by in SO example code (except where it is the point of the code), so please do fix that wherever you see it.[...]
Now I get that void main()
is not standard in C++, it never has been and I do not think it ever will be. I personally point that out to the OP in a comment and normally I link to What should main() return in C and C++?. The editor did have that in their comment
You might also admonish the OP about it. When you have the time.
Which I agree with but if the code is changed to int main()
then the comment looks out of place as there is no void main()
in the code anymore.
So do we really want to change the OP's code in this case or should we leave it alone and politely inform the user that they should not be using void main()
?
I disagree with the dupe closure. The dupe states that the edit should not change the intent of the OP. That is what I am trying to figure out in this question. Does changing void main() to int main() which has no effect on the code except to make it compile on compliant compilers changing the intent or not and if it does not then should we still do it or not.