|
| From: | Jose E. Marchesi |
| Subject: | Re: [PATCH 4/6] poke: Add new function pk_assert_alloc |
| Date: | Fri, 08 May 2020 09:21:08 +0200 |
| User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> +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 !?
WTF I was still reading a macro... sorry, I was very distracted
yesterday! XD
| [Prev in Thread] | Current Thread | [Next in Thread] |