On Mon, 26 Aug 2024 15:27:59 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:On Fri, Aug 23, 2024 at 12:14:22AM +0200, Stefano Brivio wrote:What do you mean by mandatory? This is not covered in any special way by the kernel coding style documentation, and that statement is not a compound statement: $ cat dowhile.c #include <stdio.h> int main() { int a = 3; do printf("%i\n", a--); while (a); return 0; } $ gcc -Wall -Wextra -pedantic -std=c89 -o dowhile dowhile.c $ ./dowhile 3 2 1 but sure, if you suggest that curly brackets improve clarity here, I have nothing against them. -- StefanoOn Thu, 15 Aug 2024 17:50:22 +0200 Laurent Vivier <lvivier(a)redhat.com> wrote:[snip]Unlike if, while or for, I'm pretty sure the braces are mandatory for do {} while.+ if (sz_payload) { + do { + ret = recv(conn_fd, &vmsg->payload, sz_payload, 0); + } while (ret < 0 && (errno == EINTR || errno == EAGAIN));No need for curly brackets, it's a one-line statement.