S
Seebs
Here's what got me. I had the book still open to page 464 (from looking
something up), and happened to glance over at 465.
strtoll
#include <stdlib.h>
long long int strtoll(const char * restrict start,
char ** restrict end, int radix);
strtoll() was added by C99.
The strtoll() function is similar to strtol() except that it
returns a long long int. If the result cannot be represented
by a long integer, LLONG_MAX or LLONG_MIN is returned, and the
global errno is set to ERANGE, indicating a range error. If
start does not point to a number, no conversion takes place and
zero is returned.
(Side note: strtol() doesn't have restrict in C:TCR, but the text explains
that it does in C99, so that's fine.)
Consider, if you will, a machine on which LLONG_MAX > LONG_MAX, and a
call to strtoll() with a string containing a value equal to LONG_MAX + 1.
According to Schildt, it will return LLONG_MAX.
Now, this is pretty trivial to figure out -- clearly, a cut and paste
followed by not editing. Still, I think this suggests that maybe it's time
to come up with some kind of taxonomy for these errors, so we can sort
them by type, severity, or humor value.
-s
something up), and happened to glance over at 465.
strtoll
#include <stdlib.h>
long long int strtoll(const char * restrict start,
char ** restrict end, int radix);
strtoll() was added by C99.
The strtoll() function is similar to strtol() except that it
returns a long long int. If the result cannot be represented
by a long integer, LLONG_MAX or LLONG_MIN is returned, and the
global errno is set to ERANGE, indicating a range error. If
start does not point to a number, no conversion takes place and
zero is returned.
(Side note: strtol() doesn't have restrict in C:TCR, but the text explains
that it does in C99, so that's fine.)
Consider, if you will, a machine on which LLONG_MAX > LONG_MAX, and a
call to strtoll() with a string containing a value equal to LONG_MAX + 1.
According to Schildt, it will return LLONG_MAX.
Now, this is pretty trivial to figure out -- clearly, a cut and paste
followed by not editing. Still, I think this suggests that maybe it's time
to come up with some kind of taxonomy for these errors, so we can sort
them by type, severity, or humor value.
-s