Results 1 to 3 of 3

Thread: Static Analysis to Find Bugs

  1. #1
    Join Date
    Mar 2008
    Location
    Somewhere out there...
    Posts
    361

    Default Static Analysis to Find Bugs

    I was surprised to find progress being made on iADOM. The iADOM "team" may want to consider using the static analysis Xcode provides to find bugs. [Product -> Analyze] The static analysis is complaining about things in the LUA source files in my project. It will probably find a boatload of wild and "wonderful" things in the ADOM source code.

  2. #2
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    1,878

    Default

    Thanks for the tip! I'm aware of the static analysis in Xcode and I've been using on the ADOM sources. I don't think it found anything critical in ADOM. But every port to a new operating system or switch to a different compiler resulted in the discovery of one or more problems, that we're undiscovered before.
    “It's a cruel and random world, but the ChAoS is all so beautiful.” ― Hiromu Arakawa

  3. #3
    Join Date
    Mar 2008
    Location
    Somewhere out there...
    Posts
    361

    Default

    The nice thing about the static analysis is that it should find a lot of the universal bugs that live in the portable portion of your code base. The static analysis is not perfect though. It can and will complain about tricky coding practices like the crazy pointer stuff some people do (probably a good thing). It will also complain about some coding practices that enhance maintainability or readability but serve no purpose in the program. For example:
    Code:
    void my_function() {
      int offset = 0;
      offset = do_something_a();
      offset = do_something_b();
      offset = do_something_c();  // complains that the last value stored in 'offset' is never read
    }
    Also, can click on the analysis warning to get a step by step walkthrough of the perceived problem. Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •