[v3,2/2] build: treat warning as an error on Windows

Message ID 20200528231455.13636-3-pallavi.kadam@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Fix Windows compiler warnings |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Kadam, Pallavi May 28, 2020, 11:14 p.m. UTC
  Added -Werror in meson file to consider all the warnings
as errors on Windows.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 config/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Thomas Monjalon June 11, 2020, 4:12 p.m. UTC | #1
29/05/2020 01:14, Pallavi Kadam:
> Added -Werror in meson file to consider all the warnings
> as errors on Windows.
> 
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
> --- a/config/meson.build
> +++ b/config/meson.build
> +# add -Werror to treat warnings as errors on Windows
> +if is_windows
> +	warning_flags += '-Werror'
> +endif

This should be not needed.
When configuring meson in a CI, we are supposed to use
--werror as it is done in devtools/test-meson-builds.sh.
  
Kadam, Pallavi June 11, 2020, 6:54 p.m. UTC | #2
On 6/11/2020 9:12 AM, Thomas Monjalon wrote:
> 29/05/2020 01:14, Pallavi Kadam:
>> Added -Werror in meson file to consider all the warnings
>> as errors on Windows.
>>
>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> ---
>> --- a/config/meson.build
>> +++ b/config/meson.build
>> +# add -Werror to treat warnings as errors on Windows
>> +if is_windows
>> +	warning_flags += '-Werror'
>> +endif
> 
> This should be not needed.
> When configuring meson in a CI, we are supposed to use
> --werror as it is done in devtools/test-meson-builds.sh.
> 
> 
> 
Ok, will fix this in v4.
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 43ab11310..c3c1c0c4e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -208,6 +208,10 @@  warning_flags = [
 	'-Wno-packed-not-aligned',
 	'-Wno-missing-field-initializers'
 ]
+# add -Werror to treat warnings as errors on Windows
+if is_windows
+	warning_flags += '-Werror'
+endif
 if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
 # FIXME: Bugzilla 396
 	warning_flags += '-Wno-zero-length-bounds'