This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67799] The function strtoul and strtoull in <cstdlib> do not work correctly


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67799

8826055 at 163 dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #2 from 8826055 at 163 dot com ---
(In reply to Jonathan Wakely from comment #1)
> If you look in <cstdlib> you will see these functions are not provided by
> GCC's header, they come from your C library, so this is nothing to do with
> GCC.
> 
> In any case, cplusplus.com is wrong, the functions behave as required by the
> C standard:
> 
>   If the subject sequence begins with a minus sign, the value resulting from
>   the conversion is negated (in the return type).

But the C standard also says "If the correct value is outside the range of
representable values, LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX, ULONG_MAX, or
ULLONG_MAX is returned (according to the return type and sign of the value, if
any)".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]