[Libva] [PATCH] va.h: fix compile warning

Li, ZhijianX zhijianx.li at intel.com
Tue Nov 22 00:51:45 UTC 2016



> -----Original Message-----
> From: Xiang, Haihao
> Sent: Monday, November 21, 2016 11:25 PM
> To: Li, ZhijianX <zhijianx.li at intel.com>; libva at lists.freedesktop.org
> Subject: RE: [Libva] [PATCH] va.h: fix compile warning
> 
> Although taking unspecified arguments is obsolete, I don't see any failure
> caused by ' typedef int (*VAPrivFunc)()'
> Which compiler are you using, could you provide more info in the commit log?

If we specify compiling option with "-Werror=strict-prototypes", we can got the following failure.
/opt/yami/vaapi/include/va/va.h:294:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
 typedef int (*VAPrivFunc)();
 ^

Currently, I got this failure while I included this header to QEMU.

Thanks
Zhijian

> 
> Thanks
> Haihao
> 
> >-----Original Message-----
> >From: Libva [mailto:libva-bounces at lists.freedesktop.org] On Behalf Of Li
> >Zhijian
> >Sent: Monday, November 21, 2016 6:18 PM
> >To: libva at lists.freedesktop.org
> >Subject: [Libva] [PATCH] va.h: fix compile warning
> >
> >define the VAPrivFunc with parameter 'void'
> >
> >va.h will be installed, and it will cause a compiling failure if someone
> include
> >this header to his code. So this change make the compiler happy.
> >
> >Signed-off-by: Li Zhijian <zhijianx.li at intel.com>
> >---
> > va/va.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/va/va.h b/va/va.h
> >index 153a89b..8791906 100644
> >--- a/va/va.h
> >+++ b/va/va.h
> >@@ -291,7 +291,7 @@ const char *vaQueryVendorString (
> >     VADisplay dpy
> > );
> >
> >-typedef int (*VAPrivFunc)();
> >+typedef int (*VAPrivFunc)(void);
> >
> > /**
> >  * Return a function pointer given a function name in the library.
> >--
> >2.7.4
> >
> >_______________________________________________
> >Libva mailing list
> >Libva at lists.freedesktop.org
> >https://lists.freedesktop.org/mailman/listinfo/libva


More information about the Libva mailing list