[syslinux] [PATCH 1/2] linux/syslinux.c: Silence warnings

H. Peter Anvin hpa at zytor.com
Sat Jun 19 19:13:31 PDT 2010


On 06/19/2010 07:00 PM, Gene Cumm wrote:
>>
>> Okay, what *blithering idiot* put warn_unused_result on *asprintf*?!!!!
>>
> 
> Sometimes this use of the warn_unused_result attribute seems a little
> redundant.  If you check the results the other way, you should know
> what happened or if there was an error.
> 

The way to find out if asprintf() had an error is to check the pointer
for NULL, not to check the return value.  The return value is merely the
length of the string, just as for other printf variants.

Seems like someone simply didn't think about what they were doing...

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.




More information about the Syslinux mailing list