All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-man@vger.kernel.org
Subject: [Bug 215844] New: scanf manpage incorrectly says that ll (ell-ell) is equivalent to L
Date: Sat, 16 Apr 2022 10:58:08 +0000	[thread overview]
Message-ID: <bug-215844-11311@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=215844

            Bug ID: 215844
           Summary: scanf manpage incorrectly says that ll (ell-ell) is
                    equivalent to L
           Product: Documentation
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: man-pages
          Assignee: documentation_man-pages@kernel-bugs.osdl.org
          Reporter: rootkea@gmail.com
        Regression: No

Hello!

manpage of scanf says that "Specifying two l characters is equivalent to L".
But that's not true.

Please check the following code snippet:
#include <stdio.h>

int main(void)
{
        long double ld;
        long long n;

        scanf("%Lf", &ld);
        scanf("%llf", &ld);

        scanf("%Ln", &n);
        scanf("%lln", &n);

        return 0;
}

gcc throws these warnings correctly:
warning: use of ‘ll’ length modifier with ‘f’ type character has either no
effect or undefined behavior [-Wformat=]
    9 |         scanf("%llf", &ld);
      |                   ^
warning: use of ‘L’ length modifier with ‘n’ type character has either no
effect or undefined behavior [-Wformat=]
   11 |         scanf("%Ln", &n);
      |                  ^

I think, we need to add separate entry for `ll` (ell-ell) like printf(3).

Also, another related issue is that scanf(3) doesn't mention that conversion
specifiers like `%Ld`, `%Li` etc. are GNU nonstandard extensions unlike
printf(3) which clearly mentions the nonportable part.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

             reply	other threads:[~2022-04-16 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-16 10:58 bugzilla-daemon [this message]
2022-04-16 18:21 ` [Bug 215844] scanf manpage incorrectly says that ll (ell-ell) is equivalent to L bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-215844-11311@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.