#1941: Add CCTK_BUILTIN_TRAP -------------------------+-------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: new Priority: unset | Milestone: Component: Cactus | Version: development version Keywords: | -------------------------+-------------------------------------------------- See <https://bitbucket.org/cactuscode/cactus/pull-requests/29/add- cctk_builtin_trap/diff>.
#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.
#1941: Add CCTK_BUILTIN_TRAP --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reopened Priority: unset | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+------------------------------------------------- Changes (by rhaas):
* status: review => reopened
#1941: Add CCTK_BUILTIN_TRAP --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: closed Priority: unset | Milestone: Component: Cactus | Version: development version Resolution: fixed | Keywords: --------------------------+------------------------------------------------- Changes (by rhaas):
* status: reopened => closed * resolution: => fixed
Comment:
Merged into master of the flesh in git commit 5348cba8.
trac@lists.einsteintoolkit.org