Skip to content

Commit 4e2b277

Browse files
authored
Fix #14038 (Simplecpp: update to 1.5.1) (#7708)
1 parent 1d9ea2f commit 4e2b277

File tree

12 files changed

+346
-471
lines changed

12 files changed

+346
-471
lines changed

addons/misra.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,20 +1823,6 @@ def misra_3_1(self, rawTokens):
18231823
self.reportError(token, 3, 1)
18241824
break
18251825

1826-
def misra_3_2(self, rawTokens):
1827-
for token in rawTokens:
1828-
if token.str.startswith('//'):
1829-
# Check for comment ends with trigraph which might be replaced
1830-
# by a backslash.
1831-
if token.str.endswith('??/'):
1832-
self.reportError(token, 3, 2)
1833-
# Check for comment which has been merged with subsequent line
1834-
# because it ends with backslash.
1835-
# The last backslash is no more part of the comment token thus
1836-
# check if next token exists and compare line numbers.
1837-
elif (token.next is not None) and (token.linenr == token.next.linenr):
1838-
self.reportError(token, 3, 2)
1839-
18401826
def misra_4_1(self, rawTokens):
18411827
for token in rawTokens:
18421828
if (token.str[0] != '"') and (token.str[0] != '\''):
@@ -4718,7 +4704,7 @@ def fillVerifyExpected(verify_expected, tok):
47184704
# data.rawTokens is same for all configurations
47194705
if cfgNumber == 0:
47204706
self.executeCheck(301, self.misra_3_1, data.rawTokens)
4721-
self.executeCheck(302, self.misra_3_2, data.rawTokens)
4707+
#self.executeCheck(302, self.misra_3_2, data.rawTokens)
47224708
self.executeCheck(401, self.misra_4_1, data.rawTokens)
47234709
self.executeCheck(402, self.misra_4_2, data.rawTokens)
47244710
self.executeCheck(501, self.misra_5_1, cfg)

addons/test/misra/misra-test.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,6 @@ static void misra_2_7_b(int a, int b, int c, // 2.7
121121
static void misra_2_7_c(int a, ...) { (void)a; }
122122
static void misra_2_7_d(int) { } // 2.7 8.2
123123

124-
static void misra_3_2(int enable)
125-
{
126-
// This won't generate a violation because of subsequent blank line \
127-
128-
int y = 0;
129-
int x = 0; // 3.2 non-compliant comment ends with backslash \
130-
if (enable != 0)
131-
{
132-
++x; // This is always executed
133-
// 3.2 potentially non-compliant comment ends with trigraph resolved to backslash ??/
134-
++y; // This is hidden if trigraph replacement is active
135-
}
136-
137-
(void)printf("x=%i, y=%i\n", x, y); //21.6
138-
}
139-
140124
extern int misra_5_1_extern_var_hides_var_x;
141125
extern int misra_5_1_extern_var_hides_var_y; //5.1
142126
int misra_5_1_var_hides_var________a; // 8.4

cfg/qt.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5428,6 +5428,8 @@
54285428
<define name="Q_LOGGING_CATEGORY(name,...)" value=""/>
54295429
<define name="QT_FORWARD_DECLARE_CLASS(name)" value="class name;"/>
54305430
<define name="QT_FORWARD_DECLARE_STRUCT(name)" value="struct name;"/>
5431+
<define name="QT_VERSION_CHECK(major, minor, patch)" value="((major&lt;&lt;16)|(minor&lt;&lt;8)|(patch))"/>
5432+
<define name="QT_CONFIG(feature)" value="1"/>
54315433
<!-- https://doc.qt.io/qt-6/qqmlintegration-h-qtqml-proxy.html -->
54325434
<define name="QML_ADDED_IN_VERSION(MAJOR, MINOR)" value=""/>
54335435
<define name="QML_ANONYMOUS" value=""/>

cfg/wxwidgets.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
<operatorEqVarError>
110110
</operatorEqVarError>
111111
</type-checks>
112+
<!-- https://github.com/wxWidgets/wxWidgets/blob/master/include/wx/version.h -->
113+
<define name="wxCHECK_VERSION(major,minor,release)" value="1"/>
112114
<!-- http://docs.wxwidgets.org/trunk/group__group__funcmacro__string.html#ga437ea6ba615b75dac8603e96ec864160 -->
113115
<!-- #define wxT(string) -->
114116
<define name="wxT(str)" value="str"/>

0 commit comments

Comments
 (0)