[Piglit] [PATCH] cmake: Do not build tests using designated initializers with older GCC.

Dylan Baker dylan at pnwbakers.com
Mon Apr 1 17:35:14 UTC 2019


Quoting Vinson Lee (2019-03-29 23:37:55)
> Designated initializers are not supported in older versions of GCC.
> 
> tes-gs-max-output.cpp:138: error: expected primary-expression before ‘.’ token
> tes-gs-max-output.cpp:139: error: expected primary-expression before ‘.’ token
> tes-gs-max-output.cpp:140: error: expected primary-expression before ‘.’ token
> tes-gs-max-output.cpp:141: error: expected primary-expression before ‘.’ token
> tes-gs-max-output.cpp:142: error: expected primary-expression before ‘.’ token
> tes-gs-max-output.cpp:143: error: expected primary-expression before ‘.’ token
> tes-gs-max-output.cpp:144: error: expected primary-expression before ‘.’ token
> 
> gs-max-output.cpp:98: error: expected primary-expression before ‘.’ token
> gs-max-output.cpp:99: error: expected primary-expression before ‘.’ token
> gs-max-output.cpp:100: error: expected primary-expression before ‘.’ token
> gs-max-output.cpp:101: error: expected primary-expression before ‘.’ token
> gs-max-output.cpp:102: error: expected primary-expression before ‘.’ token
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  .../spec/arb_tessellation_shader/CMakeLists.gl.txt |    4 +++-
>  .../glsl-1.50/execution/geometry/CMakeLists.gl.txt |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt b/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
> index 058a1bc..7975510 100644
> --- a/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
> +++ b/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
> @@ -18,6 +18,8 @@ piglit_add_executable (arb_tessellation_shader-invalid-primitive invalid-primiti
>  piglit_add_executable (arb_tessellation_shader-minmax minmax.c)
>  piglit_add_executable (arb_tessellation_shader-large-uniforms large-uniforms.c)
>  piglit_add_executable (arb_tessellation_shader-layout-mismatch layout-mismatch.c)
> -piglit_add_executable (arb_tessellation_shader-tes-gs-max-output tes-gs-max-output.cpp)
> +if (NOT (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6))
> +       piglit_add_executable (arb_tessellation_shader-tes-gs-max-output tes-gs-max-output.cpp)
> +endif()
>  
>  # vim: ft=cmake:
> diff --git a/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt b/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> index c6d21f0..9e496dd 100644
> --- a/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> +++ b/tests/spec/glsl-1.50/execution/geometry/CMakeLists.gl.txt
> @@ -20,7 +20,9 @@ piglit_add_executable (glsl-1.50-gs-mismatch-prim-type gs-mismatch-prim-type.c)
>  piglit_add_executable (glsl-1.50-query-gs-prim-types query-gs-prim-types.c)
>  piglit_add_executable (glsl-1.50-gs-input-layout-qualifiers gs-input-layout-qualifiers.c)
>  piglit_add_executable (glsl-1.50-gs-output-layout-qualifiers gs-output-layout-qualifiers.c)
> -piglit_add_executable (glsl-1.50-gs-max-output gs-max-output.cpp)
> +if (NOT (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6))
> +       piglit_add_executable (glsl-1.50-gs-max-output gs-max-output.cpp)
> +endif()
>  piglit_add_executable (glsl-1.50-gs-max-output-components gs-max-output-components.c)
>  piglit_add_executable (glsl-1.50-transform-feedback-type-and-size transform-feedback-type-and-size.c)
>  piglit_add_executable (glsl-1.50-transform-feedback-vertex-id transform-feedback-vertex-id.c)
> -- 
> 1.7.1
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

GCC claims that designated initializer support was added in 3.0, is -std=gnu99
not getting set correctly for you? It looks like the default for 4.6 is gnu89.

https://gcc.gnu.org/c99status.html

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20190401/2a229432/attachment.sig>


More information about the Piglit mailing list