Menu

#32 Use of format attribute with GNU compiler

None
closed-accepted
nobody
None
5
2026-03-17
2008-06-18
No

Applying the format attribute to functions with a printf-like signature allows the GNU compiler to verify that all the parameters needed by the format string are present, and are of the correct type. In case parameters do not match the format string, a warning is issued.

I think this would be very useful if applied to functions with an ellipsis in the Category class, allowing early detection of otherwise difficult to find bugs in client applications.

I attach the modified Category.hh file.

Best regards and thanks for the library,

Paolo

Discussion

  • Paolo Tedesco

    Paolo Tedesco - 2008-06-18

    Category.hh with format checking for GNU compiler

     
  • Alexander Perepelkin

    • status: open --> closed-accepted
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB