EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Results from analyzing Codacy issues
From: "Konrad, Martin via Core-talk" <core-talk at aps.anl.gov>
To: "Johnson, Andrew N." <anj at anl.gov>, Karl Vestin <karl.vestin at ess.eu>
Cc: "core-talk at aps.anl.gov" <core-talk at aps.anl.gov>
Date: Wed, 12 Feb 2020 14:15:09 +0000
>> - Possible null pointer dereferencing. In a handful of instances
>> pointers are dereferenced without NULL check. The pointer should
>> not be NULL, so practical impact is probably low. But correcting is
>> again very easy.
> 
> If the routine is static (so only visible to other routines inside
> the same source file) I would prefer to not add unnecessary NULL
> tests, but for routines that are meant to be a public API NULL tests
> probably should be added. IMHO, others may have a different opinion…
On the other hand compilers might optimize unneeded null checks away if
they can tell that a variable cannot be null. A modern compiler and
link-time optimization might be required to make this happen, though.

-Martin

-- 
Martin Konrad
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: konrad at frib.msu.edu

References:
Results from analyzing Codacy issues Karl Vestin via Core-talk

Navigate by Date:
Prev: [Bug 1824732] Re: iocsh crashes when dealing with NULL iocshArgPersistentString mdavidsaver via Core-talk
Next: Build failed: epics-base-test base-7.0-33 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Results from analyzing Codacy issues Johnson, Andrew N. via Core-talk
Next: Re: Results from analyzing Codacy issues Konrad, Martin via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 12 Feb 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·