Branch
Hash :
74f3ed88
Author :
Date :
2024-11-19T09:11:22
doc: mention strtol no-conversion + EINVAL
@node strtol
@subsection @code{strtol}
@findex strtol
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/strtol.html}
Gnulib module: strtol
@mindex strtol
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some old platforms.
@item
This function does not parse the leading @samp{0} when the input string is
@code{"0x"} and the base is 16 or 0 on some platforms:
Minix 3.3, mingw, MSVC 14.
@item
This function does not parse binary integers (with a @samp{0b} or @samp{0B}
prefix) when the base is 2 or 0 on many platforms.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
If no conversion could be performed, this function sets @code{errno}
to @code{EINVAL} on some platforms. Portable programs should check
for no conversion by comparing @code{str} to @code{*endptr}, not by
inspecting @code{errno}.
@end itemize