From a66cdfd0978015c2f3eedc968a40637f850aa917 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 4 Dec 2011 09:04:50 -0800 Subject: Fix builds of scope.c with Solaris Studio compilers Required in order to build with Studio cc now that xorg-macros is setting -errwarn=E_FUNC_HAS_NO_RETURN_STMT since a bug in the Solaris system headers causes the noreturn attribute to not be correctly applied to the exit() prototype in when building with Studio instead of gcc. Otherwise compiler exits with error: "scope.c", line 643: Function has no return statement : CMDQuit Uses Studio-specific pragma instead of adding another exit() prototype with a noreturn attribute to avoid causing gcc to warn about having a redundant prototype for the exit() function. Signed-off-by: Alan Coopersmith --- scope.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scope.c') diff --git a/scope.c b/scope.c index 2fec497..9b0ddf9 100644 --- a/scope.c +++ b/scope.c @@ -633,6 +633,11 @@ CMDStep ( return CMDProceed; } +#ifdef __SUNPRO_C +/* prevent "Function has no return statement" error for CMDQuit */ +#pragma does_not_return(exit) +#endif + static CMDResult CMDQuit ( int argc, -- cgit v1.2.1