[Bug 215844] New: scanf manpage incorrectly says that ll (ell-ell) is equivalent to L

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxx
          Reporter: rootkea@xxxxxxxxx
        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.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux