[PATCH 5/5] Add dummy return 0 to Xnest & Xephyr io error handler for Sun compilers
Alan Coopersmith
alan.coopersmith at oracle.com
Fri Dec 2 10:48:16 PST 2011
Required in order to build with Studio cc now that xorg-macros is
setting -errwarn=E_FUNC_HAS_NO_RETURN_STMT since it doesn't
recognize that the noreturn attribute makes it pointless.
Otherwise compiler exits with errors:
"Display.c", line 65: Function has no return statement : x_io_error_handler
"hostx.c", line 341: Function has no return statement : x_io_error_handler
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
hw/kdrive/ephyr/hostx.c | 3 +++
hw/xnest/Display.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 47a6681..8f0b98d 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -338,6 +338,9 @@ x_io_error_handler (Display *dpy) {
CloseWellKnownConnections();
OsCleanup(1);
exit(1);
+#ifdef __SUNPRO_C
+ return 0; /* Stop compiler from warning function has no return statement */
+#endif
}
int
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index 7acad75..d278ab5 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -61,6 +61,9 @@ x_io_error_handler (Display *dpy) {
CloseWellKnownConnections();
OsCleanup(1);
exit(1);
+#ifdef __SUNPRO_C
+ return 0; /* Stop compiler from warning function has no return statement */
+#endif
}
void
--
1.7.3.2
More information about the xorg-devel
mailing list