Re: [gtk-list] Re: Apprarently simple signal/event question
- From: Joe Pfeiffer <pfeiffer cs nmsu edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Apprarently simple signal/event question
- Date: Mon, 13 Dec 1999 20:39:06 -0700
In-Reply-To: Paul Carter's message of "Mon, 13 Dec 1999 11:25:01 -0600"
Paul Carter <carterp@acm.org> writes:
> Actually, it's very common for integal return values to be left in a
> register, not in memory. So returning a value would not cause memory
> corruption. For example, on x86, gcc leaves the return value in the
> EAX register.
>
Fair enough.
Still, it seems like a Bad Idea (tm) to rely on this. ;-)
Most of the time, if a function returns something, it's a Good Idea to
check on it (little things like making sure read() really gave you as
many bytes as you asked for, or scanf() really converted all the
inputs you wanted it to). All the same, it is perfectly safe (at
least from the standpoint of the compiler doing evil things) to ignore
the return value if you're sure that all you want are the side effects.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]