aakash-sahai / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

warn_unused_result attribute directive ignored #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using an old gnu compiler, with all warnings displayed, the define 
checkreturn __attribute__((warn_unused_result)) is not supported. It generates 
following messages during compilation:
warning: `warn_unused_result' attribute directive ignored

To solve this, please introduce additional conditions around checkreturn 
definition like:

/* The warn_unused_result attribute appeared first in gcc-3.4.0 */
#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 
4)
    #define checkreturn
#else
    /* Verify that we remember to check all return values for proper error propagation */
    #define checkreturn __attribute__((warn_unused_result))
#endif

Original issue reported on code.google.com by cea.max....@gmail.com on 9 Aug 2012 at 6:20

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 8d5086f052f4.

Original comment by Petteri.Aimonen on 9 Aug 2012 at 1:16

GoogleCodeExporter commented 9 years ago
Fix released in nanopb-0.1.6.

Original comment by Petteri.Aimonen on 3 Sep 2012 at 5:45