compiler warnings

Stefan Seefeld stefan at codesourcery.com
Fri Nov 11 21:31:56 UTC 2005


Working on ghs support I notice that some dummy (i.e. unreachable)
return statements which we inserted only recently to make icc
happy now generate warnings with ghs.

I wonder how to address this and similar issues. A possible
solution for this particular case seems to be to define an 'UNREACHABLE_RETURN'
function macro such that

UNREACHABLE_RETURN(foobar)

would map to 'return foobar;' for compilers that would complain
about a missing return, and '' (i.e. nothing) for others warning
about unreachable statements.

This macro would be provided by config.hh, so we can adjust it to
individual compilers.

Thoughts ?


Regards,
		Stefan



More information about the vsipl++ mailing list