Wireshark-bugs: [Wireshark-bugs] [Bug 7141] Two bad NULL checks in airpcap_loader.c
Date: Thu, 26 Apr 2012 14:02:52 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7141

--- Comment #5 from Evan Huus <eapache@xxxxxxxxx> 2012-04-26 14:02:52 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Committed revision 42136.
> > > 
> > > Speaking of style(from another bug) I find this
> > > +    if (NULL == if_info) 
> > > very ugly, I prefere
> > > +    if (if_info == NULL)
> > 
> > (NULL == if_info) throws a compiler error if I typo the == as an =, where as
> > (if_info == NULL) does not. I agree it's uglier, but it is safer. To each his
> > own I guess.
> 
> No, no, no...  That's what smart compilers are for.  Smart compilers will warn
> you when you make such a typo!
> 
> (Sorry, I've been forced to read (NULL == if_info) style code for years and it
> makes me *very* grumpy!  Humans--at least not this one--don't think like that
> and we should not be forced to think backwards because the software isn't smart
> enough.)

Agreed, and since GCC is apparently smart enough to catch this now (it wasn't
last time I checked, which was admittedly forever ago), I will very happily
untwist my brain for future patches :)

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.