From patchwork Sun Dec 22 00:04:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 852888 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp2769673wrq; Sat, 21 Dec 2024 16:14:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWmRM8jHRPpQGyauQ5pq2ISouyCPlhZmxEwWb2zWVaLiUpMSaQB0We31pVSIgJobhLRzSiq5w==@linaro.org X-Google-Smtp-Source: AGHT+IEj/THtGB1y9Ae1IbrSO0TNVM+u5oHYMrjJPOblNyenWcnEOEEhjVtt02DRxEfiazlrLoiw X-Received: by 2002:a05:620a:a106:b0:7b6:f113:b658 with SMTP id af79cd13be357-7b9ba6fdb17mr1300449485a.12.1734826491691; Sat, 21 Dec 2024 16:14:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1734826491; cv=pass; d=google.com; s=arc-20240605; b=i2l/ZpDQmftz5NBt00YmAfsjs7xAZEG9bfpOPkcfdrP6jdLmNVSehIfA05LDAEngPZ O5g93rVOsb5K28md5Z+Gke3UaLk3sm7GgYoS93PYuf9ddyCpFn/18JA2s7t+mUZCMPmi 8jm+z7W9j4ABTFRkywEuRSKNq+rY/gzrdeVgkZbfR4XkPycE6FxTsuLglWi3A9JdiQIw 19uehT/AHg9wjbGPVClLjcYRgKPf1PV6qkctrP+ojL6vVmkZdRADspKyyamaCPn8DFQh xy0C735w2kUWOpCYMmRqCbcjtSfLwcWboWoIjUVVS3dhN9JSCRpkmvaVwMGoOaRK8Fwc p3iQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=5st+7vEeig88DMTTNw5mSRK3hv6uLu+7RI00YPB+aVA=; fh=uKlFkH9AUukvL1xmvBA9M7Oe4ntiJIR8HCR4+3TPd4w=; b=UHm2waSwlnjonbsmRAUEgZVtqRTQBEzvEO8m2mOtDg58QanwnDLgdZ7ugLWPZLXOC0 nhHUPty2y54Cx2Q5zuxSYbay9U6c7nHl/S5tu9KheG4//p98J1zfa7p+IGBjPp2Uon/S 4QExFq66gHBDoDQM20WsPtIscY7SsGtX+pDddZSdHJBGmCdSp8j+uW1S+CwZQZMGOzeR 52Ysagsl3k0ZiyzulFvgSV8IIYiI7UazpeTLPLRcVTQD6x8EdcRIeUPAaPCmYKgZo+sr YH9oFecfBlvu2NxPm0idAyD+bf4O8K5EAjADTy0W/fCEiI/jzxkbsmtIO4feGlZn8FI8 Bd7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Blz9sVWq; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac4ce56csi768389285a.401.2024.12.21.16.14.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 16:14:51 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Blz9sVWq; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47C883857C6D for ; Sun, 22 Dec 2024 00:14:51 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 906763858282 for ; Sun, 22 Dec 2024 00:05:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 906763858282 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 906763858282 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734825925; cv=none; b=iOreKef+/J8hopV2cmGYb76BM+7Wqr2pv4rNNBqXvnikcTn68qgR4cq9bRhdCSme9sQBZmDnFMtGb6VUrxvYCWi5MN1LOOVSwFtswxSfPUCpgUx/aW6nDV1YRDCgWCjFf2+AdA5M0DJ2Hdb6WQFllHPv/BmBcBW46BA9V9fHdyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734825925; c=relaxed/simple; bh=33KOswiBQHNkqRvsryftJw+Tg7Zk87aVaUTCyFDNkl8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=p797TRF+pwdjQXvlSKFt+m8166f4Fdgz3xUVZctVy27vJV9l+O0u/BgG/lfJngMtyJ+E/zHFH45tYag+ggtngCzTgyBBgbfExUUa+ONTWBp5Bfxyymj1cdI0h71wE7FBo9rF1Lsw9H1bXPH+axsdYZF9srFzQIA7GI+zjwCwZTg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-725c86bbae7so2766201b3a.3 for ; Sat, 21 Dec 2024 16:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734825922; x=1735430722; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5st+7vEeig88DMTTNw5mSRK3hv6uLu+7RI00YPB+aVA=; b=Blz9sVWqAKrbLAfBkxZg0S6Wt7SNRm1iMks5oJSrW9g9GDsFPh8el8KftcpAnNcNW4 FyWkZStX7a8Abb4E0zvvmDyztwX8RAOul2db5ghnGOAQzd3QorUTklwzRp2LXm9S13Zj xa07bcZXOgQ8SbftLhbUXK4jN1gCBwCCIEi1+CEabVFOvhdBq7cMjs4qWOA8lLheNog+ sr5TivJhO6tO+JxwgPZEYfBCDT33CYkQqfKF29iVBImBEpfy4A2jM9UhAoxEBy9pZqB1 IDINBIoPOpONg07gMz2FeXYVmooM0m64k5b/KX2vOiGI0H+G2AxGegiW+U2MUd+af39I uaaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734825922; x=1735430722; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5st+7vEeig88DMTTNw5mSRK3hv6uLu+7RI00YPB+aVA=; b=k37I4oB7wOyJIZphzML0rtdAjrxB5fGOUCt8BdyHOgZjrshcTByVYgRejVj+ZacmWd OIjYYA8KzNUbSYfp4LewEJWPGzrJLcJ4PAhJ8YYqCcuIcWxitVL5mu4B37/bbpz/jxlM oB0BsXQ3Mf02UHbzfCDF8Bsmgu7aVtIb21HOl/vBbCwvRvaMQF9rjmFGLb/9cCiShviS HDVsLYvd7SVYPz0usIXPb6j6b0z0cZdRPzwQLN6yrbqqT/Pxa/1pjP8XHamKF+FO2FEG 8XSvg+TyWMrEVwW+XgfrYKgDRPG3naTH8QOfDpnQjACJ5NsYsuTKhVeZWyS76HqzG9za f38Q== X-Gm-Message-State: AOJu0YzcvT+09gdoEyI5FBFloyb9IVBMLDAVKMsVpArCvvDEeMt656VX 2tKQZqCtTWLmF/+u3mrKCH76uH7YuS2bkBW9k1mehiwoNt1xLAfy X-Gm-Gg: ASbGncvpPYq2GVTEV+AXNsMRs3jjttN3v2/wNtEtPn2zD+XuqrkT/EJk1mxnFWS82l5 T1yesoGH1aqOGloHjM8DgQejHbhlEiUt4mr0ezzSMITz+YG+Vg2ri5Vjgg4FBU7wE4Ik7Bxylqa 536Ikj9m4xO472q/6VBHZjJkpRQRP65UAzQbksBzkbvUN32LF4NkctB7bgXWwvIv4pUYnovywd/ Zcj3xvfMMDzWQj9+AN25+Byuok00bAPQdoMfsBIClcry3Bale7+Xrok7r93nRhcigEIU/E= X-Received: by 2002:a05:6a00:35c9:b0:71e:6c3f:2fb6 with SMTP id d2e1a72fcca58-72abde65a60mr14290260b3a.8.1734825922417; Sat, 21 Dec 2024 16:05:22 -0800 (PST) Received: from gnu-tgl-3.localdomain ([120.204.185.181]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8dee97sm5435735b3a.126.2024.12.21.16.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 16:05:22 -0800 (PST) Received: from gnu-tgl-3.lan (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 79268C0B53; Sun, 22 Dec 2024 08:05:15 +0800 (CST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: sam@gentoo.org, Adhemerval Zanella Subject: [PATCH 30/39] stdio: Disable clang warning on scanf13 test Date: Sun, 22 Dec 2024 08:04:53 +0800 Message-ID: <20241222000509.2205895-31-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241222000509.2205895-1-hjl.tools@gmail.com> References: <20241222000509.2205895-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org From: Adhemerval Zanella Reviewed-by: Sam James --- stdio-common/scanf13.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c index 60aa62a26f..6f3ddfa1e0 100644 --- a/stdio-common/scanf13.c +++ b/stdio-common/scanf13.c @@ -3,6 +3,7 @@ #include #include #include +#include int main (void) @@ -20,6 +21,11 @@ main (void) } while (0) setlocale (LC_ALL, "de_DE.UTF-8"); + /* TODO: explain why clang need these. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); if (sscanf ("A \xc3\x84-\t\t\xc3\x84-abcdefbcd\t\xc3\x84-B", "A%ms%10ms%4m[bcd]%4mcB", &sp1, &sp2, &sp3, &sp4) != 4) FAIL (); @@ -57,6 +63,7 @@ main (void) FAIL (); free (lsp4); } + DIAG_POP_NEEDS_COMMENT_CLANG; memset (buf, '/', sizeof (buf)); buf[0] = '\t'; @@ -86,6 +93,9 @@ main (void) FAIL (); free (sp2); } + /* TODO: explain why clang need these. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); if (sscanf (buf, "%2048ms%mc", &sp3, &sp4) != 2) FAIL (); else @@ -126,6 +136,7 @@ main (void) FAIL (); free (sp4); } + DIAG_POP_NEEDS_COMMENT_CLANG; if (sscanf (buf, "%mS%mC", &lsp1, &lsp2) != 2) FAIL (); else @@ -142,6 +153,9 @@ main (void) FAIL (); free (lsp2); } + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) FAIL (); else @@ -182,6 +196,7 @@ main (void) FAIL (); free (lsp4); } + DIAG_POP_NEEDS_COMMENT_CLANG; return result; }