On Wednesday 09 July 2008 12:03:19 chromatic wrote: > On Wednesday 09 July 2008 08:27:35 Andrew Johnson wrote: > > Confirmed, those warnings have gone. I'm still getting loads of > > "warning: statement not reached" but I'll work out how to suppress those > > and post a fix separately. > > Does your compiler have a function annotation which means "This function > does not return"? If so, we can add a probe and a define for that.
Sun documents the use of a #pragma for that kind of annotation, which I don't think will be compatible with Parrot's usage since I don't think you can use C macros to declare pragmas. Here are their examples from the manual: > extern void exit(int); > #pragma does_not_return(exit) > > extern void __assert(int); > #pragma does_not_return(__assert) However I suspect it also understands the /[EMAIL PROTECTED]@*/ comment that the PARROT_DOES_NOT_RETURN macro adds since the vast majority (130) of the warning lines I see are identical: "lib/Parrot/Pmc2c/PCCMETHOD.pm", line 465: warning: statement not reached That line of PCCMETHOD.pm is the one that emits "goto no_return;". BTW, there is a fundamental problem with this very common usage of a Parrot::Pmc2c::Emitter: $e->emit( <<"END", __FILE__, __LINE__ + 1 ); ... code ... END In the above usage, __LINE__ returns the line number of the line containing the "END" marker, not that of the line containing the "emit" call, so the #line directive it emits points to the wrong place in the source file. The other warnings I get on Solaris are just these: "src/stm/backend.c", line 969: warning: statement not reached "./src/pmc/nci.pmc", line 486: warning: statement not reached "src/encodings/utf16.c", line 326: warning: statement not reached "src/encodings/utf16.c", line 455: warning: statement not reached "src/encodings/utf16.c", line 479: warning: statement not reached "src/encodings/utf16.c", line 502: warning: statement not reached "src/encodings/utf16.c", line 525: warning: statement not reached These all look to be valid warnings — the first is a return statement immediately following a call to real_exception(), and that's why I think the Sun compiler understands the /[EMAIL PROTECTED]@*/ comment, since it knew before I did that real_exception() doesn't return. The utf16 warnings are all from functions that contain UNIMPL; followed by one or more UNUSED() markers. - Andrew -- Talk is cheap. Show me the code. -- Linus Torvalds