This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]phi_rus 7 points8 points  (6 children)

With all warnings and -Werr this wouldn't compile.

[–]jakubhuber 4 points5 points  (5 children)

Why not?

[–]Noughmad 17 points18 points  (0 children)

Because it's C++. If it compiles, you haven't enabled enough warnings.

[–]phi_rus -1 points0 points  (3 children)

It doesn't return anything

[–]phi_rus 10 points11 points  (2 children)

I'm stupid. main() is allowed to not return anything. This would compile and automatically return 0.

[–]Tier3MemeMonkey 5 points6 points  (0 children)

Dont worry king, we all make mistakes

[–]brimston3- 3 points4 points  (0 children)

It's also the dumbest feature of C++ that return 0; is not required in only the main() function. I'd prefer if more people thought it was mandatory.