ROSS-org/ROSS

mark tw_error as noreturn?

JohnPJenkins opened this issue · 2 comments

__attribute__((noreturn)) in gcc/clang. I'm sure there's a similar if not the same syntax in xlc/pgi/icc, but I haven't checked yet. Could always wrap it in a macro that checks against GNUC or clang. Convenient for not having to use placeholder return's in control flows that end in a tw_error, ie

int foo(int bar) {  if (bar < 0) tw_error(TW_LOC, "oh noes!!!"); else return bar+1; }

tw_error() is marked noreturn -- see line 185.

NORETURN is similarly defined in ross.h.

Of course, I don't see support for any other compilers in the macro...

Hmm, so it is - I'll double check how I'm compiling...