Skip to content

cmsis_iccarm.h lacks of correct prototypes reported by IAR #264

Description

@PLFSTM

Hi,

Using IAR 'Required prototype' option set in the IDE, my project compilation fails on the call to the following APIs:

  • Error[Pa045]: function "__CLREX" has no prototype
  • Error[Pa045]: function "__enable_fault_irq" has no prototype
  • Error[Pa045]: function "__disable_fault_irq" has no prototype

Looking at the new introduced code in CMSIS v6.2.0

__IAR_FT void __CLREX() {
  __ASM volatile("CLREX" ::: "memory");
}

#if (defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB >= 2)
// This is not really fault_irq on Cortex-not-M. However
// there seems to be code that assumes this.
  __IAR_FT void __disable_fault_irq()
  {
    __ASM volatile ("CPSID F" ::: "memory");
  }

  __IAR_FT void __enable_fault_irq()
  {
    __ASM volatile ("CPSIE F" ::: "memory");
  }
#endif

I note that the void type is missing in the functions declaration. It must be declared as such:

__IAR_FT void __CLREX(void) {
  __ASM volatile("CLREX" ::: "memory");
}

#if (defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB >= 2)
// This is not really fault_irq on Cortex-not-M. However
// there seems to be code that assumes this.
  __IAR_FT void __disable_fault_irq(void)
  {
    __ASM volatile ("CPSID F" ::: "memory");
  }

  __IAR_FT void __enable_fault_irq(void)
  {
    __ASM volatile ("CPSIE F" ::: "memory");
  }
#endif

regards
Patrice

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions