[ET Trac] [Einstein Toolkit] #1986: this compared to NULL in CarpetLib

Einstein Toolkit trac-noreply at einsteintoolkit.org
Wed Nov 23 08:54:58 CST 2016


#1986: this compared to NULL in CarpetLib
--------------------+-------------------------------------------------------
 Reporter:  rhaas   |       Owner:  eschnett           
     Type:  defect  |      Status:  new                
 Priority:  minor   |   Milestone:                     
Component:  Carpet  |     Version:  development version
 Keywords:          |  
--------------------+-------------------------------------------------------
 I get
 {{{
 /home/rhaas/Cactus/arrangements/Carpet/CarpetLib/src/gdata.cc: In member
 function ‘void gdata::copy_from(comm_state&, const gdata*, const ibbox&,
 const ibbox&, const islab*, int, int)’:
 /home/rhaas/Cactus/arrangements/Carpet/CarpetLib/src/gdata.cc:185:53:
 warning: nonnull argument ‘this’ compared to NULL [-Wnonnull-compare]
    int const order_space = (this ? cent : src->cent) == vertex_centered ?
 1 : 0;
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
 }}}
 which leads me to suspect that the compiler is allowed to assume this !=
 NULL and will optimize out one half of the condition.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1986>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list