Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

-Werror ignored?

Nolta__Mike
Beginner
466 Views

I'm wondering why the following doesn't produce an error:

$ icc -mavx512f -Werror test.c && echo ok
icc: command line warning #10159: invalid argument for option '-m'
ok

This is with version 2018.1 on linux.

0 Kudos
3 Replies
Viet_H_Intel
Moderator
466 Views

Hi Mike,

ICC issues a warning on unknown options, but gives you an option to promote it to an error.

icc -mavx512f -Werror test.c -we10159 

will emit an error instead.

Thanks,

Viet 

0 Kudos
Nolta__Mike
Beginner
466 Views

Thanks, but the question remains: why doesn't -Werror work?

0 Kudos
Viet_H_Intel
Moderator
466 Views

-Werror forces warnings to be reported as errors on source code, not command line options.

Thanks,

Viet 

0 Kudos
Reply