Skip to content

Commit cc44966

Browse files
authored
std.cfg: remove wrong macro replacements for UINT32_C etc. (#5527)
The replacements should be platform dependent.
1 parent 960e8bb commit cc44966

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

addons/test/misra/misra-test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ static void misra_10_3(uint32_t u32a, uint32_t u32b) {
696696
res = 2U + 3U; // no warning, utlr=unsigned char
697697
res = 0.1f; // 10.3
698698
const char c = '0'; // no-warning
699+
uint32_t u = UINT32_C(10); // no-warning
699700
}
700701

701702
static void misra_10_4(u32 x, s32 y) {

cfg/std.cfg

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0"?>
22
<def format="2">
3-
<!-- helpers -->
4-
<define name="__CONCATenate(left, right)" value="left ## right"/>
5-
<define name="__CONCAT(left, right)" value="__CONCATenate(left, right)"/>
63
<!-- stdint.h -->
74
<define name="INT8_MIN" value="-128"/>
85
<define name="INT16_MIN" value="-32768"/>
@@ -40,17 +37,6 @@
4037
<define name="UINT_LEAST16_MAX" value="65535U"/>
4138
<define name="UINT_LEAST32_MAX" value="4294967295U"/>
4239
<define name="UINT_LEAST64_MAX" value="18446744073709551615U"/>
43-
<!-- Macros for integer constants -->
44-
<define name="INT8_C(value)" value="((int8_t) value)"/>
45-
<define name="UINT8_C(value)" value="((uint8_t) __CONCAT(value, U))"/>
46-
<define name="INT16_C(value)" value="value"/>
47-
<define name="UINT16_C(value)" value="__CONCAT(value, U)"/>
48-
<define name="INT32_C(value)" value="__CONCAT(value, L)"/>
49-
<define name="UINT32_C(value)" value="__CONCAT(value, UL)"/>
50-
<define name="INT64_C(value)" value="__CONCAT(value, LL)"/>
51-
<define name="UINT64_C(value)" value="__CONCAT(value, ULL)"/>
52-
<define name="INTMAX_C(value)" value="__CONCAT(value, LL)"/>
53-
<define name="UINTMAX_C(value)" value="__CONCAT(value, ULL)"/>
5440
<!-- math.h -->
5541
<define name="M_E" value="2.7182818284590452354"/>
5642
<define name="M_LOG2E" value="1.4426950408889634074"/>

0 commit comments

Comments
 (0)