http://llvm.org/bugs/show_bug.cgi?id=15527

            Bug ID: 15527
           Summary: Feature request: warn on possibly-infinite loops
                    without sequence points
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

It is common in threaded code to see things like "while (foo->bar) continue;"
where bar is a field of the struct pointed to by foo which is expected to be
changed in another thread (or on signal, or ...)  Usually, correct
implementations would have an unlock and a relock (or ideally a block on a
condition variable), thus putting a sequence point within the loop and
requiring the compiler to reload the value of foo->bar over and over again, or
bar or foo may be declared volatile, however occasionally implementations that
are so simplistic do occur.

I would like to see the static analyzer detect these conditions, namely by
detecting that a loop conditional will only be checked once, and then will
either proceed or will reliably enter into an infinite loop.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to