Hacker News new | past | comments | ask | show | jobs | submit login

> I know others who lost an entire day staring at it wondering what's wrong with it. I saw it on X recently as "99% of C programmers will not be able to find the bug."

Both gcc and clang give a warning[1] for that code with just "-Wall", so I's hard to imagine it being a real problem these days.

[1] https://godbolt.org/z/vfPzhc596




I know modern compilers do it, too. But still the language needs to be fixed. The proof is C programmers still get victimized by this useless feature.

Compiler warnings are a good source of material for things that need to be fixed in the language. Unfortunately, every compiler has their own set of warnings, and sometimes warnings from different compilers contradict each other. That encourages programmers to not use the warning feature. That's another reason why the language should be fixed.


In my experience the warnings work quite well for the programmers I know.

Anyway, ranting on HackerNews does not get anything fixed: https://www.open-std.org/jtc1/sc22/wg14/www/contributing.htm...


Working in offshoring projects for the lowest bid changes one's point of view, regarding "programmers I know" approach.


I work a lot with students who can not program well in C. I would say turning on -Wall is not a difficult problem for them. If it is, then using another programming language also does not help.


That is already progress, compared with the quality of delivery in many offshoring projects.

It usually might go so bad, that after a couple of years, a new management ends up onshoring it all over again.

You might turn -Wall, but then who fixes the warnings?

And better be prepared to fight managament if warnings break the build, as it "slows down sprint velocity with useless coding efforts".

Unless required by some kind of certification laws or quality assessement on project delivery.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: