[Bug other/89863] [meta-bug] Issues that static analyzers (cppcheck, clang-static-analyzer) find that gcc misses

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 10 13:31:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89863

--- Comment #7 from David Binderman <dcb314 at hotmail dot com> ---
For this C++ code:

// Division by zero.

extern void g();

void f()
{
    unsigned int vsync_rate_hz = 0;
    unsigned int frame_time_microsec = 1000000 / vsync_rate_hz;

    g();
}

gcc and clang have nothing to say, even with -g -O2 -Wall -Wextra 
but cppcheck finds the problem.


More information about the Gcc-bugs mailing list