[PATCH 1.10] "privates.h", line 198: warning: void function cannot return value

Alan Coopersmith alan.coopersmith at oracle.com
Thu Jun 2 10:27:53 PDT 2011


On 06/ 2/11 03:32 AM, Nicolas Kaiser wrote:
> * Alan Coopersmith <alan.coopersmith at oracle.com>:
>> Providing an argument to return in a function with void return type
>> is not allowed by the C standard, and makes the Sun compilers unhappy.
>> (They actually flag it as an error, unless using a new enough version
>>  to be able to downgrade it to a warning with "-features=extensions".)
> 
> Out of curiosity, would the below function have the same problem?
> It looks to me pretty much identical in this respect.

Yes it does:
"rrcrtc.c", line 635: warning: void function cannot return value

The primary difference is that it appears just once in the output, instead
of hundreds of times across the build of the server & drivers as the warning
from privates.h did.  Thanks for catching it.

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>


> Best regards,
> Nicolas Kaiser
> ---
> Signed-off-by: Nicolas Kaiser <nikai at nikai.net>
> ---
>  randr/rrcrtc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
> index d4d8f2a..0437795 100644
> --- a/randr/rrcrtc.c
> +++ b/randr/rrcrtc.c
> @@ -632,7 +632,7 @@ RRModeGetScanoutSize (RRModePtr mode, PictTransformPtr transform,
>  void
>  RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height)
>  {
> -    return RRModeGetScanoutSize (crtc->mode, &crtc->transform, width, height);
> +    RRModeGetScanoutSize (crtc->mode, &crtc->transform, width, height);
>  }
>  
>  /*


-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list