Menu

#61 Semicolons after if-statement

v1.0_(example)
closed
None
5
2014-02-16
2013-11-28
No

GCC produces warnings of the following kind:

error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

The code lines GCC warns about are the following:

  • src/protocol.c line 494: if(rtOpts->masterRefreshInterval > 9 );
  • src/dep/servo.c line 896: if(rtOpts->servoDtMethod == DT_CONSTANT);
  • src/dep/iniparser/iniparser.c line 528: if(sscanf(entry,":%[^:]:",section)>0);
  • src/dep/iniparser/iniparser.c line 530: if(sscanf(entry,"%[^:]:",section)>0);

Note the semicolons at the end of each line.

Seen on ptpd version 2.3.0.

Discussion

  • Wojciech Owczarek

    • status: open --> accepted
    • assigned_to: Wojciech Owczarek
     
  • Wojciech Owczarek

    Thanks for the bug report - we really need testers :)

     
  • Fredrik Möller

    Fredrik Möller - 2013-12-08

    Thanks for the fix in [r444]. Perfect!

    Regards,
    Fredrik

     

    Related

    Commit: [r444]

  • Wojciech Owczarek

    • status: accepted --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB