This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to make ARM compiler report compilation warnings, as error?

Note: This was originally posted on 24th November 2008 at http://forums.arm.com

I want the compiler to report all compilation warnings as errors, in ARM C Compiler. Didn't get any help from the Specs. Has anyone tried this? How can I do it?
  • Note: This was originally posted on 25th November 2008 at http://forums.arm.com

    You can do it for individual messages using the [url="http://infocenter.arm.com/help/topic/com.arm.doc.dui0348b/CHDJDADE.html"]--diag_error[/url] switch. However, the GNU-style "-Wall" and "-Werror" switches do not work with the ARM compiler so you're out of luck there. I don't know of another way to achieve this using command-line switches.

    One option is to parse the output using your build system. A simple script could be written to check for warning messages and return an error condition if any are found.

    Please post on here if you find a good solution to this, as I (and probably others) would be interested to see how this can be achieved.

    Thanks,
    Jacob
  • Note: This was originally posted on 24th November 2008 at http://forums.arm.com

    HI Tarun,
    To treat compiler warnings as error,  you need add  complier option (it like  -Wall -Werror) .
    in same way search option with respect your compiler.
    regards,
    Veeru


    I want the compiler to report all compilation warnings as errors, in ARM C Compiler. Didn't get any help from the Specs. Has anyone tried this? How can I do it?
  • Note: This was originally posted on 27th November 2008 at http://forums.arm.com

    I want the compiler to report all compilation warnings as errors, in ARM C Compiler. Didn't get any help from the Specs. Has anyone tried this? How can I do it?

    I guess warnings are issued when we don't comply with the syntax of the language we use. And if you want it as an error, you can try this as well. from RVCT Compiler Reference Guide, command line options :

    When --strict is in force and a violation of the relevant ISO standard occurs, the compiler issues an error message.
    The severity of diagnostic messages can be controlled in the usual way.
    Example:
    void foo(void)
    {
        long long i; /* okay in non-strict C90 */
    }
    Compiling this code with --strict generates an error.

    good luck
    cheers
    Aj