[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
signature.asc
Description: OpenPGP digital signature
- [PATCH 2/6] libpoke: Use strndup instead of xstrndup, (continued)
[PATCH 4/6] poke: Add new function pk_assert_alloc, Tim Rühsen, 2020/05/07
[PATCH 5/6] poke: Remove unneeded header includes., Tim Rühsen, 2020/05/07
[PATCH 6/6] ios: Amend OOM message to be consistent everywhere., Tim Rühsen, 2020/05/07
Re: [PATCH 1/6] Check return value of pk_str_concat, Jose E. Marchesi, 2020/05/07