[EMAIL PROTECTED] wrote:
Hi, C language does not support exceptions on arithmetic overflow. How do
people handle these situations? Do you use custom assembly code to check the
status of machine registers after arithmetic operations, or do you simply
ignore it and pretend it would never happen? If you do check for overflow, are
there any examples in Solaris kernel?

Since you're talking about the kernel, I assume you mean integer overflow. Generally, we either know overflow won't occur (eg
number of bytes sent is a 64 bit quantity, for example) or we check
for it explicitly.  Examples of the latter can easily be found
with the following search string:

http://cvs.opensolaris.org/source/search?q=overflow&defs=&refs=&path=onnv%2Fonnv-gate%2Fusr%2Fsrc%2Futs&hist=

- Bart


--
Bart Smaalders                  Solaris Kernel Performance
[EMAIL PROTECTED]               http://blogs.sun.com/barts
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to