Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building with IAR #276

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Commits on Sep 13, 2022

  1. Remove implicit conversions between function and data pointers

    IAR generates errors Pe144 'a value of type "int32_t (*)(int32_t)" cannot
    be used to initialize an entity of type "void *" and Pe513 'a value of
    type "int32_t (*)(int32_t)" cannot be assigned to an entity of type
    "void *"'.
    
    Also, when citing the name of a specific function, there's no need to use
    the '&' operator before the symbol - it's already typed as a function
    pointer.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    cf23c92 View commit details
    Browse the repository at this point in the history
  2. M_PI is a GNU extension to math.h, so define it locally if necessary

    IAR generates error Pe020 'identifier is undefined'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    17e70b9 View commit details
    Browse the repository at this point in the history
  3. Adapt to lack of typeof in hw_set_alias and hw_clear_alias

    When building with IAR, these macros expand to void pointers, so without an
    explicit cast, IAR generates error Pe132 'expression must have
    pointer-to-struct-or-union type but it has type "void *".
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    9f70f6f View commit details
    Browse the repository at this point in the history
  4. Remove unreachable code

    IAR generates warning Pe111 'statement is unreachable'. GCC doesn't
    complain about their absence, if they are removed.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    a3dbe56 View commit details
    Browse the repository at this point in the history
  5. Avoid branch-past-initialisation warning

    IAR generates warning Pe546 'transfer of control bypasses initialization
    of variable'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    22bf069 View commit details
    Browse the repository at this point in the history
  6. Fix undefined order of volatile accesses

    IAR generates warning Pa082 'undefined behavior: the order of volatile
    accesses is undefined in this statement'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    14f786e View commit details
    Browse the repository at this point in the history
  7. Make conversion to uint32_t of negative constant explicit

    IAR generates warning Pe068 'integer conversion resulted in a change of
    sign'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    6c612fd View commit details
    Browse the repository at this point in the history
  8. Avoid using non-standard escape sequence in string literals

    IAR generates warning Pe192 'unrecognized character escape sequence'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    53c3a47 View commit details
    Browse the repository at this point in the history
  9. Do explicit conversion from floating point to integer

    IAR generates warning Pa093 'implicit conversion from floating point to
    integer'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    8a6deba View commit details
    Browse the repository at this point in the history
  10. Wrap GCC pragmas in #ifdef __GNUC__

    IAR generates warning Pe161 'unrecognized #pragma'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    6a0f652 View commit details
    Browse the repository at this point in the history
  11. Explicitly convert between enum and integer

    IAR generates warning Pe188 'enumerated type mixed with another type'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    fc121aa View commit details
    Browse the repository at this point in the history
  12. Remove unused static functions

    IAR generates warning Pe177 'function was declared but never referenced'.
    Ben Avison committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    443447f View commit details
    Browse the repository at this point in the history