#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 knarf):
I would probably omit the do-while (only using a pair of {}):
{{{ #define CCTK_VError(...) \ { \ CCTK_VWarn(0,__VA_ARGS__); \ exit(0); \ } }}}
As to the attribute: we could set it but we otherwise often try to conform to standards most of the time, and IMHO we should if we can. I am not sure if all 'important compilers' support this attribute and before we use it we should be sure that all do. Then of course we might hit the problem that codes already using
{{{ CCTK_WARN(0,""); exit(1); }}}
could produce a warning that the call to exit cannot be reached if a compiler suddenly knows that CCTK_WARN will not return. :)