---------- Forwarded message ---------- From: Per Inge Mathisen <[EMAIL PROTECTED]> Date: Jul 11, 2007 9:32 AM Subject: Re: [Warzone-dev] [Warzone-commits] r2051 - /trunk/lib/ivis_opengl/tex.c To: Development list <warzone-dev@gna.org>
On 7/11/07, Giel van Schijndel <[EMAIL PROTECTED]> wrote: > > Silence a Valgrind warning by not free()ing a NULL pointer > Since free(NULL) is a valid NO-OP I don't think we should obfuscate our > code with if(ptr) free(ptr) like code. I'm no expert on Valgrind, but I > would guess that you can disable warnings individually. I do not see why if (ptr) free(ptr) is obsfucating. To me it is clear as day what the code does. It also *does* add useful information to the reader: It says that we *expect* ptr to sometimes be NULL at this point. Since knowledge of when ptr can and cannot be NULL is useful information, I like programs that give warnings for free(NULL), whatever the standard might say about it being legal or not. We can set ourselves higher standards than the C standard ;-) - Per -------------------------------------------------------
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev