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, [email protected] wrote:
> >> From: José Fonseca <[email protected]>
> >>
> >> 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 <[email protected]>
From 71079e509d1e17e2e1a9fdd5e4cc6ce7b13abef3 Mon Sep 17 00:00:00 2001
From: Jan Vesely <[email protected]>
Date: Wed, 29 Oct 2014 15:57:56 -0400
Subject: [Piglit][PATCH 1/1] cmake: Add check for variable size arrays

not supported by c89

Signed-off-by: Jan Vesely <[email protected]>
---
 CMakeLists.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6c48bc..3a5b9c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -219,6 +219,11 @@ if (NOT MSVC)
 		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdeclaration-after-statement")
 	ENDIF (C_COMPILER_FLAG_WDECL_AFTER_STMT)
 
+	CHECK_C_COMPILER_FLAG("-Wvla" C_COMPILER_FLAG_WVLA)
+	IF (C_COMPILER_FLAG_WVLA)
+		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wvla")
+	ENDIF (C_COMPILER_FLAG_WVLA)
+
 	CHECK_CXX_COMPILER_FLAG("-Wno-narrowing" CXX_COMPILER_FLAG_WNO_NARROWING)
 	IF (CXX_COMPILER_FLAG_WNO_NARROWING)
 		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
-- 
1.9.3

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to