ancruna / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

add GCC format attribute to enable compile-time warnings for mg_printf #300

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This adds a GCC-specific hint (only when compiling with GCC, of course) which 
lets the compiler check the fmt argument to mg_printf() against the variadic 
arguments.  This can and does help catch bugs at compile-time, including type 
mismatches between say "%s" and an int argument.

Original issue reported on code.google.com by jzwi...@gmail.com on 29 Nov 2011 at 10:45

Attachments:

GoogleCodeExporter commented 9 years ago
This is related to the comment on Issue #295, but this patch does not overlap 
with the patch there--they are complimentary (and this one provides a feature 
for end users, whereas that one claims to improve internal correctness).

Original comment by jzwi...@gmail.com on 29 Nov 2011 at 10:50

GoogleCodeExporter commented 9 years ago
Thanks, submitted 
https://code.google.com/p/mongoose/source/detail?r=8fab0aa49b4c12110d37ecb786c31
996d7a4ffa7

Original comment by valenok on 24 Jan 2012 at 4:06