Menu

#52 802.15.4 empty body in if statement

open
nobody
ns-2 (62)
5
2010-03-08
2010-03-08
No

Reported by Maxime de Roucy:

Compiling with -Wextra option gave me :

wpan/p802_15_4csmaca.cc:424: warning: suggest braces around empty body
in an 'if' statement
wpan/p802_15_4csmaca.cc:431: warning: suggest braces around empty body
in an 'if' statement

In fact the code is :

if (canProceed(wtime));
backoffHandler();

Where the if have absolutely no effect ..

My question : does we change the code for :

canProceed(wtime);
backoffHandler();

or

if (canProceed(wtime))
{
backoffHandler();
}

Discussion


Log in to post a comment.