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

Gene Cumm gene.cumm at gmail.com
Sat Jun 19 19:31:37 PDT 2010


On Sat, Jun 19, 2010 at 22:13, H. Peter Anvin <hpa at zytor.com> wrote:
> 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.

Exactly what I was thinking when I said that.

>
> 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.

-- 
-Gene




More information about the Syslinux mailing list