[PATCH 5/5] Add dummy return 0 to Xnest & Xephyr io error handler for Sun compilers

walter harms wharms at bfs.de
Sat Dec 3 06:51:05 PST 2011


Hi,

perhaps you can call it DUMMY_RETURN or so ?
Other compilers may have the same idea.

Otherwise ... will gcc complain ? If not something like:
  return 0; /* make  SUNPRO C happy */
would sufficent.

re,
 wh

Am 02.12.2011 19:48, schrieb Alan Coopersmith:
> 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


More information about the xorg-devel mailing list