Menu

A new thread safety addon

2023-02-11
2023-05-18
  • Andrew C Aitchison

    I have taken the idea in the y2038.py addon and now have a new addon which warns about functions whose man page "Attribute" section marks them as MT-Unsafe.

    Most important question: should I add this to the existing addon
    threadsafety.py
    or make a new addon ?

    I have two scripts which can generate the list of MT-Unsafe functions;
    the original is in perl which I am comfortable with, and a python
    translation
    which seems very fragile, but should have no dependencies that the
    addon does not.
    I will include these scripts when I submit the addon.

    flake8 without a config warns about the existing cppcheck addons.
    Is there a flake8 style or other linter/analyser I should use
    with python code in the cppcheck project ?

    For now the three scripts are available in
    https://www.aitchison.me.uk/cppcheck/threadsafety.functions/

     
  • Andrew C Aitchison

    Should this be added to the existing threadsafety.py or be a new addon ?

    Any python checkers I should use ?

     
    • Daniel Marjamäki

      It sounds like a good idea. Please feel free to add this checking in threadsafety.py

       
  • Andrew C Aitchison

    Replacement threadsafety.py and a script MT-Unsafe.py to help maintain the list of unsafe objects, as found in the ATTRIBUTES section of man pages (reads the troff source).

     
  • Andrew C Aitchison

    Of course, as soon as I sent the scripts I find more bugs added when merging the new code (taken from y2038.py) into threadsafety.py.
    Treat these as draft versions whilst I do more testing (and maybe include a test .cpp file).

     
  • CHR

    CHR - 2023-05-18

    Have you thought about opening a PR at https://github.com/danmar/cppcheck ?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.