News for hackers. Stuff that matters.
Re:GCC should warn about 2^16 and 2^32 and 2^64 by inlined on Monday June 17, 2019 @11:30AM (#20203950)
Static analyzers existed long before the clang compiler. SAL from Microsoft is used extensively in every codebase I’ve worked with in Windows and it’s amazing, even if you have to get used to macros on all your functions’ parameters.

https://docs.microsoft.com/en-us/visualstudio/code-quality/u...

Re:GCC should warn about 2^16 and 2^32 and 2^64 by pjmlp on Monday June 17, 2019 @12:29PM (#20204600)
Surely, and I appreciate its existence.

Just making the point that they have been largely ignored.

Re:GCC should warn about 2^16 and 2^32 and 2^64 by geezerjay on Monday June 17, 2019 @01:57PM (#20205655)
That is not a fair assertion. You might have ignored static analyzers until you've discovered clang, but that observation is not generalizable. As others have already pointed out, lint has been used extensively for decades.
Re:GCC should warn about 2^16 and 2^32 and 2^64 by pjmlp on Monday June 17, 2019 @02:13PM (#20205825)
I have been using static analysers since the mid-90's.

Ever heard of PC Lint from Gimpel? It was my first one.

Or do you think I would be critic of how many use C, without adopting best practices myself?

One learns a lot about code quality, or lack thereof, when doing enterprise consulting.

Re:GCC should warn about 2^16 and 2^32 and 2^64 by naikrovek on Monday June 17, 2019 @08:35PM (#20208756)
> One learns a lot about code quality, or lack thereof, when doing enterprise consulting.

Pure truth, there. One has seen neither really awful code nor really great code until they have seen the wide array of code quality produced by an enterprise with a few decades of software development history. Any enterprise will suffice, it doesn't have to be a huge corporate entity.

There are a very few developers who are really good and who really care, and there are very few who really do not care and who are really not good, and most are somewhere in between.

Re:GCC should warn about 2^16 and 2^32 and 2^64 by pjmlp on Tuesday June 18, 2019 @09:35AM (#20212785)
As addendum to my reply, here are the answer to JetBrains questionnaire about the C++ eco-system among their customers.

Check "Which of the following tools do you or your team use for guideline enforcement or other code quality/analysis?" results.

https://www.jetbrains.com/lp/devecosystem-2019/cpp/