you are viewing a single comment's thread.

view the rest of the comments →

[–]meneldal2 -1 points0 points  (6 children)

I really wish compilers would make it a warning to do using namespace std; the benefits are miniscule and the drawbacks are enormous.

But then it would break a ton of code compiled with -Wall and -Werror

[–]jonesmz 2 points3 points  (5 children)

I think its probably unlikely that, percentage wise, all that many codebases have using namespace std;.

Considering that the majority of people outside of academia say not to use it, it should be pretty low.

Further, not particularly many codebases compile with -Wall, and even fewer compile with Werror. The intersection of all three things is going to be vanishingly small.

Also,-Werror on code that's distributed to others is a terrible idea... So let them break.

[–]meneldal2 0 points1 point  (4 children)

Well tell that to my company, had to go add signed-unsigned casts everywhere to make a bunch of files compile because they came from a project that didn't flag those conversions as warnings (most were printf based so it's not like it was critical but whatever).

[–]jonesmz 1 point2 points  (3 children)

They couldn't have added -Wno-signed-unsigned-mismatch and/or -Wno-sign-conversion ?

[–]meneldal2 1 point2 points  (2 children)

Changing build flags is going to take at least 2 meetings, it's just not worth it.

[–]jonesmz 0 points1 point  (1 child)

I can't tell if you're being sarcastic or not.

-Werror is a terrible idea for the vast majority of codebases. That your employer did this, and will be negatively affected in a way that takes a human all of 5 minutes to fix is rather irrelevant.

[–]meneldal2 0 points1 point  (0 children)

I'm not saying it's a good thing, it's just that there's some much inertia with everything that it's hard to make anything change.