Re: [gtk-list] Re: Apprarently simple signal/event question




   1) is this really dangerous?

It depends on the call, and on what you consider dangerous.
Disregarding a return value will not, in and of itself, cause you any
trouble.  Ever.  I don't know why a function like memcpy bothers to
return a pointer, since there is no new information in it and there's
no reason to look at it.

On the other hand, most function return values are there for a
reason.  You should definitely check whether write() actually wrote as
many bytes as you told it to for instance; if it didn't, then
something has gone seriously awry and your program needs to know about
it.

while I'm on the topic, I'll mention what I regard as the worst
possible thing to do with error return values:  telling the user about
it and proceeding anyway as if nothing were wrong.  If the Gimp can't
open a swap file, it pops a window warning the user (so far so good)
and continues.  It then notices that it needs a swap file....  on a
couple of occasions, I've had to bring down the X server because it
was bringing up the popups faster than I could get rid of them.  I
just sent a bug report in on gnorpm; if there is no package ID on an
RPM in the web find window, it reports the fact on stderr, and then
tries to dereference the resulting NULL pointer (BOOM).

   2) if so, why does glib use calls like the above

Haven't read the source; don't know.

   3) am I misunderstanding something here?

Not that I know of.
-- 
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]