From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 8BB75385843E for ; Sat, 16 Apr 2022 18:21:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8BB75385843E Received: by mail-wr1-x431.google.com with SMTP id e21so14097790wrc.8 for ; Sat, 16 Apr 2022 11:21:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=215VwteWtqqgiTtyAA01w8+X4fUc3TXzAqchJbtX12A=; b=PXBJMG5sUyB8QYlGop58ilpoGCZSPA3ePK5o6fpcQVI4YvNZWm00n2rAfrqn2UXz+X Zi+cifuy6KNaXA/B0JAQ5tcj9R0opqYfcLcpd0gEufWjm55TK7a2WFwIH/w0qokYZuhT uB/yCdSD8eO9+6+F9+nKoqpy/kGzfJqGVru5+s+FrijMO54dFCeeTNHJAosigrGFW18h 2HqyNIwfO6L0T2cylhs7FkUSxHOvjEyzaq3pvUhWoO2U/LJ9l1yZVJpB9ZOuluNfPCSh pE63EkgQDYDbro3pviUfoNHYSMft3phsCqG6B4ohLkcf7JuxtVytdkVG0Y1WEWpzd/DB sGBA== X-Gm-Message-State: AOAM530hS2OC4yx6YUQJNgd/QWdudt+Sp/GKHNiSkWYzvnqAsjuMd1MK CMxUKzgV79ah8qdM3laiSqM= X-Google-Smtp-Source: ABdhPJxJyaupuI7m2FxKCJFjUSEL7vRIaULxf8PgaU/X2r2MAPpFleAhKQqPlGQ7nQTX00b5oEisrw== X-Received: by 2002:a5d:4e49:0:b0:20a:850c:2f77 with SMTP id r9-20020a5d4e49000000b0020a850c2f77mr3114711wrt.246.1650133270191; Sat, 16 Apr 2022 11:21:10 -0700 (PDT) Received: from asus5775.alejandro-colomar.es ([170.253.36.171]) by smtp.googlemail.com with ESMTPSA id o8-20020a5d6488000000b002051f1028f6sm7450585wri.111.2022.04.16.11.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Apr 2022 11:21:09 -0700 (PDT) From: Alejandro Colomar To: bugzilla-daemon@kernel.org, linux-man@vger.kernel.org Cc: Alejandro Colomar , Avinash Sonawane , glibc , GCC Subject: [PATCH] [Bug 215844] scanf.3: Clarify ll and L modifiers Date: Sat, 16 Apr 2022 20:19:43 +0200 Message-Id: <20220416181942.5464-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2022 18:21:13 -0000 Relevant documents: POSIX: glibc: ISO C2x: Still, from the documentation linked above, it seems to me that "%Ln" is supported as a glibc extension, and doesn't fall into "either no effect or undefined behavior" as says the GCC warning shown in the bugzilla report. I didn't modify the documentation regarding %n, and recommend investigating a possible GCC bug. Reported-by: Avinash Sonawane Link: bugzilla Cc: glibc Cc: GCC Signed-off-by: Alejandro Colomar --- man3/scanf.3 | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/man3/scanf.3 b/man3/scanf.3 index 55058f3d2..199c8a19a 100644 --- a/man3/scanf.3 +++ b/man3/scanf.3 @@ -308,10 +308,6 @@ and the next pointer is a pointer to .I double (rather than .IR float ). -Specifying two -.B l -characters is equivalent to -.BR L . If used with .B %c or @@ -320,12 +316,33 @@ the corresponding parameter is considered as a pointer to a wide character or wide-character string respectively. .\" This use of l was introduced in Amendment 1 to ISO C90. .TP +.B ll +(ell-ell) +Indicates that the conversion will be one of +.BR b , +.BR d , +.BR i , +.BR o , +.BR u , +.BR x , +.BR X , +or +.B n +and the next pointer is a pointer to a +.I long long +or +.I unsigned long long +(rather than +.IR int ). +.TP .B L Indicates that the conversion will be either \fBe\fP, \fBf\fP, or \fBg\fP and the next pointer is a pointer to .I "long double" -or the conversion will be +or +(as a GNU extension) +the conversion will be \fBd\fP, \fBi\fP, \fBo\fP, \fBu\fP, or \fBx\fP and the next pointer is a pointer to .IR "long long" . @@ -683,17 +700,17 @@ floating-point conversion specifier (and is unaffected by etc.). .SH BUGS All functions are fully C89 conformant, but provide the -additional specifiers +additional modifiers .B q and .B a as well as an additional behavior of the .B L and -.B l -specifiers. +.B ll +modifiers. The latter may be considered to be a bug, as it changes the -behavior of specifiers defined in C89. +behavior of modifiers defined in C89. .PP Some combinations of the type modifiers and conversion specifiers defined by ANSI C do not make sense -- 2.30.2