Re: C return a++ - is it safe?
- From: santosh <santosh.k83@xxxxxxxxx>
- Date: Sun, 04 Nov 2007 20:27:59 +0530
RoS wrote:
<snip>
you and other seems not understand the esistance of variables that
*can not* overflow e.g. size_t; or
int, unsigned, float, double etc in financial calculis etc etc
No. Signed types can overflow.
if some of that variables has an overflow it has to rappresent an
error number (eg: INT_MAX for +overflow and INT_MIN for -overflow)
so detect errors in run time is more easy
INT_MAX and INT_MIN are valid values. Using them to represent overflow
is, IMHO, not wise.
for an unsigned thype the aritimetic is very easy....
0..UMAX
0..UMAX-1 is ok
UMAX is an error
No. Uxxx_MAX is a valid value of that type.
.
- References:
- Re: C return a++ - is it safe?
- From: Chris Hills
- Re: C return a++ - is it safe?
- From: CBFalconer
- Re: C return a++ - is it safe?
- From: RoS
- Re: C return a++ - is it safe?
- Prev by Date: Re: A Trend Towards Lower Software Maintenance Budgets?
- Next by Date: Re: C Questions
- Previous by thread: Re: C return a++ - is it safe?
- Next by thread: Re: C return a++ - is it safe?
- Index(es):
Relevant Pages
|
|