[Bug c/53871] Please warn about endless loops if they are obvious

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 30 19:05:00 GMT 2015


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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
Derived from the current Linux kernel:

// i never changes, so the code loops forever.

extern int f2( int);

void f1()
{
        int i = 0;

        do {
                int n = f2( i);

                if (n < 0 || n > 10)
                        break;
        } while (i < 8);
}

$ ~/gcc/results/bin/gcc -c -g -O2 -Wall -Wextra dec30b.cc
$


More information about the Gcc-bugs mailing list