[webkit-dev] "statement is unreachable" warnings

Yong Li yong.li.webkit at gmail.com
Fri Jan 22 07:08:55 PST 2010

RVCT reports a "statement is unreachable" warning in this case:

while (true) {
   // no break in the loop
      return someValue;
     return someValue;

return someValue;

I understand that if we remove the last return statement, some compilers
will complain that "not all paths return a value".

So how about adding a macro "UNREACHABLE_RETURN(valueToReturn)"?

Like this:

#define UNREACHABLE_RETURN(valueToReturn) // nothing here
 #define UNREACHABLE_RETURN(valueToReturn)   \
return valueToReturn;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100122/204b6fcf/attachment.html>

More information about the webkit-dev mailing list