Browse Source

cortex-m: Suppress cppcheck error about uninitialized result

False positive, the variable result is assigned from within inline assembly
dev/timer
Joakim Gebart 8 years ago
parent
commit
01c5120039
  1. 7
      cpu/cortex-m0_common/include/core_cmFunc.h
  2. 7
      cpu/cortex-m3_common/include/core_cmFunc.h
  3. 7
      cpu/cortex-m4_common/include/core_cmFunc.h

7
cpu/cortex-m0_common/include/core_cmFunc.h

@ -345,6 +345,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
uint32_t result;
__ASM volatile ("MRS %0, control" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -372,6 +373,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void)
uint32_t result;
__ASM volatile ("MRS %0, ipsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -387,6 +389,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
uint32_t result;
__ASM volatile ("MRS %0, apsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -402,6 +405,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void)
uint32_t result;
__ASM volatile ("MRS %0, xpsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -417,6 +421,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void)
register uint32_t result;
__ASM volatile ("MRS %0, psp\n" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -444,6 +449,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
register uint32_t result;
__ASM volatile ("MRS %0, msp\n" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -471,6 +477,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void)
uint32_t result;
__ASM volatile ("MRS %0, primask" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}

7
cpu/cortex-m3_common/include/core_cmFunc.h

@ -345,6 +345,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
uint32_t result;
__ASM volatile ("MRS %0, control" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -372,6 +373,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void)
uint32_t result;
__ASM volatile ("MRS %0, ipsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -387,6 +389,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
uint32_t result;
__ASM volatile ("MRS %0, apsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -402,6 +405,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void)
uint32_t result;
__ASM volatile ("MRS %0, xpsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -417,6 +421,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void)
register uint32_t result;
__ASM volatile ("MRS %0, psp\n" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -444,6 +449,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
register uint32_t result;
__ASM volatile ("MRS %0, msp\n" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -471,6 +477,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void)
uint32_t result;
__ASM volatile ("MRS %0, primask" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}

7
cpu/cortex-m4_common/include/core_cmFunc.h

@ -345,6 +345,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void)
uint32_t result;
__ASM volatile ("MRS %0, control" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -372,6 +373,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void)
uint32_t result;
__ASM volatile ("MRS %0, ipsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -387,6 +389,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void)
uint32_t result;
__ASM volatile ("MRS %0, apsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -402,6 +405,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void)
uint32_t result;
__ASM volatile ("MRS %0, xpsr" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -417,6 +421,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void)
register uint32_t result;
__ASM volatile ("MRS %0, psp\n" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -444,6 +449,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void)
register uint32_t result;
__ASM volatile ("MRS %0, msp\n" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}
@ -471,6 +477,7 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void)
uint32_t result;
__ASM volatile ("MRS %0, primask" : "=r" (result) );
/* cppcheck-suppress uninitvar */
return(result);
}

Loading…
Cancel
Save