From patchwork Sat Nov 25 23:05:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Haehnel X-Patchwork-Id: 1868484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernkonzept.com header.i=@kernkonzept.com header.a=rsa-sha256 header.s=mx1 header.b=hevMzUOx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sd6sC5SwNz1yS6 for ; Sun, 26 Nov 2023 10:05:49 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id EA5773520F60; Sun, 26 Nov 2023 00:05:39 +0100 (CET) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernkonzept.com header.i=@kernkonzept.com header.a=rsa-sha256 header.s=mx1 header.b=hevMzUOx; dkim-atps=neutral Received: from mx.kernkonzept.com (serv1.kernkonzept.com [159.69.200.6]) by helium.openadk.org (Postfix) with ESMTPS id 254CE3520DD0 for ; Sun, 26 Nov 2023 00:05:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kernkonzept.com; s=mx1; h=Content-Transfer-Encoding:MIME-Version:Message-ID :Date:Subject:Cc:To:From:References:In-Reply-To:Reply-To:Content-Type: Content-ID:Content-Description; bh=wdMwKRrtUgC/KW6tiseF9G4AZCaLTodsbfu8nn+Iwms=; b=hevMzUOxBsE7vi7qB0hJz1sm8A EooPeCDQtHBrocr+bkO2ZiPkLuJM9Ky3t2iJjVf9scYAWMqZQkrUODZrlT3abMCTPxM+ANbJ3d5Mw Ru/crHwtnHFErdTRTwn1HDWaQ3+21Mr6Pc0lJutcaCgnNi22/qDpNGwTwhBIQHXH1nBUf7dBv8PQh ckj4O84a+2dWMEjMevv62AFHeJri9I6WwJmxj2TA7JqhNk4WV2ujIbM8qWe/zZRpP2R6SrPfzNcQM i5zQeq96m6S9TuPAGX3vd/CePgGRuflVNLgE5wwv/Bpbnui0y+y/xppXLVAE/BzL7z9wPJ0N25SvP cN0OFVqA==; Received: from [2a00:1f:4700:3001:9ecc:fff4:5955:348e] (helo=amethyst.dd1.int.kernkonzept.com) by mx.kernkonzept.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) id 1r71iN-007maC-0z; Sun, 26 Nov 2023 00:05:31 +0100 From: Marcus Haehnel To: devel@uclibc-ng.org Date: Sun, 26 Nov 2023 00:05:19 +0100 Message-ID: <20231125230546.8992-1-marcus.haehnel@kernkonzept.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Message-ID-Hash: QTBQC2KBURF7NLUDN6UUA7VAALCOOHOQ X-Message-ID-Hash: QTBQC2KBURF7NLUDN6UUA7VAALCOOHOQ X-MailFrom: marcus.haehnel@kernkonzept.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Marcus Haehnel X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH] getaddrinfo.c: Avoid misleading indentation warning List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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)