[Piglit] [PATCH 2/2] gl-1.0-readpixsanity: Eliminate use of variable length arrays.

Jan Vesely jan.vesely at rutgers.edu
Wed Oct 29 13:36:45 PDT 2014


On Wed, 2014-10-29 at 16:38 +0000, Jose Fonseca wrote:
> On 29/10/14 16:20, Jan Vesely wrote:
> > On Wed, 2014-10-29 at 11:48 +0000, jfonseca at vmware.com wrote:
> >> From: José Fonseca <jfonseca at vmware.com>
> >>
> >> Non-standard GCC extension.
> >
> > just FYI, it's not GCC extension, it's c99 standard.
> 
> I think you're right.
> 
> I assumed it was not standard because per 
> https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html GCC variable 
> length array supports goes beyond C99 specs, and MSVC 2013 supposedly 
> supports C99, but per 
> http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx 
> this is *library*, not full syntax support.
> 
>  > maybe we can use more msvc compatible set of gcc flags (-std=c89
>  > -pedantic? ) for code that needs to compile in windows
> 
> No, unfortunately that's too restrictive.  MSVC supports a few things 
> beyond C89, so -std=c98/-pendantic ends up complaining about a bunch 
> things that we use and are supported everywhere.

yeah, I thought it would be as easy as -pedantic and
-Wno-"msvc-supported-feature".
but not all -pedantic warnings can be disabled, and there is no way to
allow single line comments (//) with --std=c89.

I have attached a patch that adds vla warning if you are interested.

regards,
jan


> 
> Jose

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cmake-Add-check-for-variable-size-arrays.patch
Type: text/x-patch
Size: 1007 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141029/13db8bda/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141029/13db8bda/attachment.sig>


More information about the Piglit mailing list