poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/6] poke: Add new function pk_assert_alloc


From: Tim Rühsen
Subject: Re: [PATCH 4/6] poke: Add new function pk_assert_alloc
Date: Fri, 8 May 2020 08:59:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 07.05.20 18:39, Jose E. Marchesi wrote:
>     
>     +static inline void
>     +pk_assert_alloc(const void *m)
> 
> No space after function name.

Thanks. I wonder if we have a syntax-check rule for that somewhere.

> 
>     +{
>     +  if (!m)
>     +    {
>     +      pk_printf (_("out of memory\n"));
>     +      exit (EXIT_FAILURE);
>     +    }
>     +}
> 
> Please use a do { .. } while (0) instead of a compound statement.

Sorry, i can't follow. That is a function body and an if statement with
two lines in the block. Why should I apply do while here ???

You do not really want a
if (!m) do {
...
...
} while (0);

do you !?

Tim

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]