Fix builds of Xnest & Xephyr 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 <stdlib.h> when building with Studio instead of gcc. 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 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 <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
This commit is contained in:
parent
e4dcf580f0
commit
c19c55a93a
|
@ -332,6 +332,11 @@ hostx_set_title (char *title)
|
||||||
ephyrTitle = title;
|
ephyrTitle = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __SUNPRO_C
|
||||||
|
/* prevent "Function has no return statement" error for x_io_error_handler */
|
||||||
|
#pragma does_not_return(exit)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int _X_NORETURN
|
static int _X_NORETURN
|
||||||
x_io_error_handler (Display *dpy) {
|
x_io_error_handler (Display *dpy) {
|
||||||
ErrorF("Lost connection to X server: %s\n", strerror(errno));
|
ErrorF("Lost connection to X server: %s\n", strerror(errno));
|
||||||
|
|
|
@ -55,6 +55,11 @@ Pixmap xnestScreenSaverPixmap;
|
||||||
XlibGC xnestBitmapGC;
|
XlibGC xnestBitmapGC;
|
||||||
unsigned long xnestEventMask;
|
unsigned long xnestEventMask;
|
||||||
|
|
||||||
|
#ifdef __SUNPRO_C
|
||||||
|
/* prevent "Function has no return statement" error for x_io_error_handler */
|
||||||
|
#pragma does_not_return(exit)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int _X_NORETURN
|
static int _X_NORETURN
|
||||||
x_io_error_handler (Display *dpy) {
|
x_io_error_handler (Display *dpy) {
|
||||||
ErrorF("Lost connection to X server: %s\n", strerror(errno));
|
ErrorF("Lost connection to X server: %s\n", strerror(errno));
|
||||||
|
|
Loading…
Reference in New Issue