sds icon indicating copy to clipboard operation
sds copied to clipboard

Use attribute 'warn_unused_result'

Open nkurz opened this issue 11 years ago • 0 comments

Hi Salvatore.

Thanks for releasing this. You should consider using the GCC (and compatible) attribute "warn_unused_result" on the functions that may call realloc().

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bwarn_005funused_005fresult_007d-attribute-2997

It's not a perfect backstop, but it can be very helpful in calling attention to usage that would otherwise be a very subtle error.

nkurz avatar Feb 06 '14 23:02 nkurz