Liste des Groupes | Revenir à cl c |
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:Ben Bacarisse <ben@bsb.me.uk> writes:>
[range questions for strtol(), etc]
>I think there /is/ something problematic with the wording about the>
negation. It happens "in the return type" but how can
9223372036854775808 be negated in the type long long int? OK, the
negated value can be /represented/ in the type long long int but that's
not quite the same thing. On the othee hand, for the unsigned return
types, the negation "in the return type" is what produces ULONG_MAX for
"-1" when the negated value, -1, can't be /represented/ in the return
type. It's a case where, over the years, I've just got used to what's
happening.
I understand what these functions do, but their specification in the
C standard is a little off. To my way of thinking the impact is
minimal, but the specified behavior is either unequivocally wrong or
there are some cases that give rise to undefined behavior.
Can you give an example where the specified behavior causes undefined
behavior?
Les messages affichés proviennent d'usenet.