Subject: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l

From: "Basil L. Contovounesios" <[email-masked]>
Date: Thu, 14 Oct 2021 16:42:24 +0100

Eli Zaretskii [2021-09-24 09:41 +0300] wrote:

>> Date: Thu, 23 Sep 2021 23:49:37 +0100
>> From: Alan Third <[email-masked]>
>> Cc: [email-masked]
>> 
>> > >> What if xmalloc or snprintf fail?
>> > >
>> > > Doesn't xmalloc causes some sort of error to occur? I'm not sure.
>> > 
>> > I think it exits only while Emacs is still initialising itself before
>> > entering the top-level command loop, and otherwise frees ballast memory
>> > and signals a Lisp error.
>> > 
>> > At least the second snprintf in svg_load_image does check xmalloc's
>> > return value.
>> 
>> None of the other uses of xmalloc in image.c check the return value
>> either, as far as I can see, and I certainly didn't write them all...
>
> AFAIR, there's no need to check the return value of xmalloc, because
> it doesn't return if it cannot allocate memory.

Are you thinking about xalloc?  If not, could you please point me to the
part of xmalloc that doesn't return (except for the !initialized branch
in memory_full)?  I'm afraid I couldn't spot it.

-- 
Basil