From 20d7d58f1aa3cd230252b6391ff5db7e84d0efa3 Mon Sep 17 00:00:00 2001 From: Marcus Haehnel Date: Sun, 26 Nov 2023 00:05:19 +0100 Subject: getaddrinfo.c: Avoid misleading indentation warning When compiling getaddrinfo.c with clang the -Wmisleading-indentation option will cause a warning due to the indentation lining up with the previous statement in the if block above. For gcc the warning is blinded by the commented line. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107162 Move the comment behind the function call to make both compilers happy. --- libc/inet/getaddrinfo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index a9000ae13..f34a4726c 100644 --- a/libc/inet/getaddrinfo.c +++ b/libc/inet/getaddrinfo.c @@ -959,8 +959,7 @@ getaddrinfo(const char *name, const char *service, last_i = i; if (hints->ai_family == AF_UNSPEC && (i & GAIH_OKIFUNSPEC)) continue; - /*if (p) - freeaddrinfo works ok on NULL too */ - freeaddrinfo(p); + freeaddrinfo(p); /* freeaddrinfo works ok on NULL too */ return -(i & GAIH_EAI); } if (end) -- cgit v1.2.3