[ET Trac] [Einstein Toolkit] #1186: Provide a version of CCTK_WARN which never returns

Einstein Toolkit trac-noreply at einsteintoolkit.org
Tue Nov 27 00:56:04 CST 2012


#1186: Provide a version of CCTK_WARN which never returns
--------------------------+-------------------------------------------------
  Reporter:  hinder       |       Owner:     
      Type:  enhancement  |      Status:  new
  Priority:  minor        |   Milestone:     
 Component:  Cactus       |     Version:     
Resolution:               |    Keywords:     
--------------------------+-------------------------------------------------

Comment (by rhaas):

 Sorry for being not clear. I'll try to clarify.

 I believe right now CCTK_VWarn is the actual function and not a macro
 while CCTK_WARN is a macro (see src/include/cctk_WarnLevel.h and
 src/include/cctk_core.h). I assume that attributes can only be used with
 functions. So if we for some reason cannot use the noreturn attribute with
 all compilers we need to support, then your suggestion of having a macro
 with an exit() call inside of the usual
 {{{
 #define CCTK_VError(...)     \
 do {                         \
   CCTK_VWarn(0,__VA_ARGS__); \
   exit(0);                   \
 } while(0)
 }}}
 is a good solution I think. I seem to have confused CCCTK_VError and
 CCTK_ERROR a bit though in my original comment.
 I summary: I think both CCTK_ERROR and CCTK_VError would be useful (in
 whatever incarnation).

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


More information about the Trac mailing list