wayland scanner writes incorrect descriptions on i586

Kristian Høgsberg hoegsberg at gmail.com
Mon Oct 15 10:01:02 PDT 2012


On Mon, Oct 15, 2012 at 12:47:33AM +0200, Olivier Blin wrote:
> Hi,
> 
> On i586, wayland scanner writes incorrect descriptions in the header
> files, see at the end of this mail for the first few differences between
> the x86_64 header and the i586 one.
> 
> On i586, desc_dump() does not use the description passed after the
> vsnprintf() parameters, but unrelated values.
> 
> It seems to be because desc_dump() is using the ap va_arg after being
> passed to vsnprintf():
>         vsnprintf(buf, sizeof buf, fmt, ap);
>         desc = va_arg(ap, char *);
> 
> And according to vsnprintf(3) and stdarg(3), the value of ap is
> undefined after the vsnprintf() call.
> 
> Couldn't the desc be moved as the first parameter of desc_dump()?
> It fixes my issue when writing the headers for i586.
> 
> I will post a patch series doing that.

I see, yes that was a little messy.  Thanks for fixing that, patches
applied.

Kristian


> Regards
> 
> --- /usr/include/wayland-server-protocol.h	2012-10-10 11:38:40.000000000 +0200
> +++ wayland-server-protocol-i586.h	2012-10-15 00:43:26.185498748 +0200
> @@ -81,11 +81,10 @@
>  #ifndef WL_DISPLAY_ERROR_ENUM
>  #define WL_DISPLAY_ERROR_ENUM
>  /**
> - * wl_display_error - global error values
> - * @WL_DISPLAY_ERROR_INVALID_OBJECT: server couldn't find object
> - * @WL_DISPLAY_ERROR_INVALID_METHOD: method doesn't exist on the
> - *	specified interface
> - * @WL_DISPLAY_ERROR_NO_MEMORY: server is out of memory
> + * wl_display_error - wl_display
> + * @WL_DISPLAY_ERROR_INVALID_OBJECT: WL_DISPLAY
> + * @WL_DISPLAY_ERROR_INVALID_METHOD: WL_DISPLAY
> + * @WL_DISPLAY_ERROR_NO_MEMORY: WL_DISPLAY
>   *
>   * These errors are global and can be emitted in response to any server
>   * request.
> @@ -98,20 +97,20 @@
>  #endif /* WL_DISPLAY_ERROR_ENUM */
>  
>  /**
> - * wl_display - core global object
> - * @bind: bind an object to the display
> - * @sync: asynchronous roundtrip
> + * wl_display - wl_display
> + * @bind: bind
> + * @sync: sync
>   *
>   * The core global object. This is a special singleton object. It is used
>   * for internal wayland protocol features.
>   */
>  struct wl_display_interface {
>  	/**
> -	 * bind - bind an object to the display
> -	 * @name: unique number id for object
> -	 * @interface: (none)
> -	 * @version: (none)
> -	 * @id: (none)
> +	 * bind - bind
> +	 * @name: name
> +	 * @interface: interface
> +	 * @version: version
> +	 * @id: id
>  	 *
>  	 * Binds a new, client-created object to the server using @name
>  	 * as the identifier.
> 
> -- 
> Olivier Blin - blino
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list