bens_dad: (Default)
[personal profile] bens_dad

cppcheck is a program which looks for problems with C and C++ code (it does what is known as a static analysis). One of its addons looks for routines that are unsafe when used in multi-thread programs (which do two or more things at once).

This threadsafety addon has a list of such routines, but of course different systems have different unsafe routines, and as systems are updated a routine may be made "MT-safe"; eg man strerror says Before glibc 2.32, strerror() is not MT-Safe. Therefore cppcheck source includes a tool which can rebuild the list by reading the man pages of the system.

Some systems are obsoleted every six months, while others are designed to be supported for a decade or longer. Ideally programs should be written to run safely on both sorts of systems.

I am coming to the conclusion that the cppcheck threadsafety addon should be released in two variants: one that only warns about problems on current systems and one that warns about problems on systems with long-term support.

Comments ? Either here or at https://sourceforge.net/p/cppcheck/discussion/general/thread/209919289c/

Output from older but still supported operating systems would be interesting. Script at:

https://raw.githubusercontent.com/danmar/cppcheck/main/tools/MT-Unsafe.py

A typical run would be something like:

python MT-Unsafe.py /usr/share/man/man3

The output will depend slightly upon which man pages are installed on your machine.

The script should run on a Mac, (/usr/share/man/man3 will probably need changing) but I am curious to know whether it can find the information in the Mac man pages, or it is in a different format.

While Windows will have many of the same routines, I know nothing about how Microsoft documents them.

(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

Profile

bens_dad: (Default)
bens_dad

June 2025

S M T W T F S
1234567
891011121314
1516 1718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Thursday, 26 June 2025 04:03 am
Powered by Dreamwidth Studios