Bug 89433 - GCC 4.2 does not support -Wvla
Summary: GCC 4.2 does not support -Wvla
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-03-04 23:36 UTC by Vinson Lee
Modified: 2015-03-18 10:55 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
make -Wvla conditional (1.44 KB, patch)
2015-03-05 02:39 UTC, Jonathan Gray
Details | Splinter Review
check if compiler supports -Werror=vla (1.74 KB, patch)
2015-03-17 02:26 UTC, Jonathan Gray
Details | Splinter Review

Description Vinson Lee 2015-03-04 23:36:57 UTC
mesa: b5eb6f769db71557c86c72c3352db149379fdade (master 10.6.0-devel)

-Wvla is available with gcc >= 4.3.

Build fails with this error.

cc1: error: -Werror=vla: No option -Wvla
Comment 1 Jonathan Gray 2015-03-05 02:39:27 UTC
Created attachment 114016 [details] [review]
make -Wvla conditional

How about the attached patch to make it conditional on the GCC version?
Comment 2 Jose Fonseca 2015-03-05 11:52:10 UTC
(In reply to Jonathan Gray from comment #1)
> Created attachment 114016 [details] [review] [review]
> make -Wvla conditional
> 
> How about the attached patch to make it conditional on the GCC version?

Thanks for looking into this. 

I worry that checking the compiler version might not work for clang. It might be better to mimic the logic we use above for -Werror=implicit-function-declaration and -Werror=missing-prototypes.
Comment 3 Jonathan Gray 2015-03-17 02:26:51 UTC
Created attachment 114359 [details] [review]
check if compiler supports -Werror=vla

new patch that does a compile check for the flag
Comment 4 Jose Fonseca 2015-03-17 20:33:43 UTC
(In reply to Jonathan Gray from comment #3)
> Created attachment 114359 [details] [review] [review]
> check if compiler supports -Werror=vla
> 
> new patch that does a compile check for the flag

configure.ac is basically m4 on top of shell/bash, right?

If so the check must be done  MSVC2013_COMPAT_* vars are referred in the MSVC2008_COMPAT_* assignment.

Otherwise looks good.
Comment 5 Jose Fonseca 2015-03-17 20:34:51 UTC
"... check must be done _before_ MSVC2013_COMPAT_* ..."
Comment 6 Jose Fonseca 2015-03-18 10:55:54 UTC
I've updated and pushed your fix (8475526a3842580f00a043bca8f821e14e9f5eb7)

Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.