[ET Trac] [Einstein Toolkit] #1941: Add CCTK_BUILTIN_TRAP

Einstein Toolkit trac-noreply at einsteintoolkit.org
Mon Jul 25 11:57:09 CDT 2016


#1941: Add CCTK_BUILTIN_TRAP
--------------------------+-------------------------------------------------
  Reporter:  eschnett     |       Owner:                     
      Type:  enhancement  |      Status:  review             
  Priority:  unset        |   Milestone:                     
 Component:  Cactus       |     Version:  development version
Resolution:               |    Keywords:                     
--------------------------+-------------------------------------------------
Changes (by rhaas):

  * status:  new => review


Comment:

 I have to admit I am not sure I see the need for these functions. On
 current compilers {{{CCTK_Abort}}} is already declared to have the
 {{{noreturn}}} attribute so the optimizer knows that it does not have to
 optimize the code branch that leads to it. In addition {{{CCTK_Abort}}}
 performs useful cleanup (it call {{{MPI_Abort}}} and can be overloaded by
 the driver which is not the case when calling a trap.

 Maybe the better comparison is really to {{{assert(0)}}} instead? In this
 case the advantage of the trap is that it cannot be made a no-op by
 defining {{{NDEBUG}}}.

 So I would only want to advertise using the trap for debugging and not in
 place of {{{CCTK_Abort}}} which provides a fairly "clean" abort route.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1941#comment:1>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list