I was just reading the glibc sscanf
man page (from the Linux man-pages package) and I found the following:
The following conversion specifiers are available:
(...)
d
Deprecated. Matches an optionally signed decimal integer; the next pointer must be a pointer toint
.
i
Deprecated. Matches an optionally signed integer; the next pointer must be a pointer toint
. The integer is read in base 16 if it begins with0x
or0X
, in base 8 if it begins with0
, and in base 10 otherwise. Only characters that correspond to the base are used.
o
Deprecated. Matches an unsigned octal integer; the next pointer must be a pointer tounsigned int
.(...)
%d
is deprecated? It seem that all int
specifiers are deprecated.As pointed in the comments (thanks to @JeffHolt, @Eugene-sh, @DanielWalker, @Barmar, @DanielWalker) , the answer is indeed in the Bugs section:
BUGS
Numeric conversion specifiers
Use of the numeric conversion specifiers produces Undefined
Behavior for invalid input. See C11 7.21.6.2/10
⟨https://port70.net/%7Ensz/c/c11/n1570.html#7.21.6.2p10⟩. This is
a bug in the ISO C standard, and not an inherent design issue
with the API. However, current implementations are not safe from
that bug, so it is not recommended to use them. Instead,
programs should use functions such as strtol(3) to parse numeric
input. This manual page deprecates use of the numeric conversion
specifiers until they are fixed by ISO C.
I do agree that of "deprecate" means here "express disapproval of" (as from @Barmar's comment).