Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions addons/misra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1823,20 +1823,6 @@ def misra_3_1(self, rawTokens):
self.reportError(token, 3, 1)
break

def misra_3_2(self, rawTokens):
for token in rawTokens:
if token.str.startswith('//'):
# Check for comment ends with trigraph which might be replaced
# by a backslash.
if token.str.endswith('??/'):
self.reportError(token, 3, 2)
# Check for comment which has been merged with subsequent line
# because it ends with backslash.
# The last backslash is no more part of the comment token thus
# check if next token exists and compare line numbers.
elif (token.next is not None) and (token.linenr == token.next.linenr):
self.reportError(token, 3, 2)

def misra_4_1(self, rawTokens):
for token in rawTokens:
if (token.str[0] != '"') and (token.str[0] != '\''):
Expand Down Expand Up @@ -4718,7 +4704,7 @@ def fillVerifyExpected(verify_expected, tok):
# data.rawTokens is same for all configurations
if cfgNumber == 0:
self.executeCheck(301, self.misra_3_1, data.rawTokens)
self.executeCheck(302, self.misra_3_2, data.rawTokens)
#self.executeCheck(302, self.misra_3_2, data.rawTokens)
self.executeCheck(401, self.misra_4_1, data.rawTokens)
self.executeCheck(402, self.misra_4_2, data.rawTokens)
self.executeCheck(501, self.misra_5_1, cfg)
Expand Down
16 changes: 0 additions & 16 deletions addons/test/misra/misra-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,6 @@ static void misra_2_7_b(int a, int b, int c, // 2.7
static void misra_2_7_c(int a, ...) { (void)a; }
static void misra_2_7_d(int) { } // 2.7 8.2

static void misra_3_2(int enable)
{
// This won't generate a violation because of subsequent blank line \

int y = 0;
int x = 0; // 3.2 non-compliant comment ends with backslash \
if (enable != 0)
{
++x; // This is always executed
// 3.2 potentially non-compliant comment ends with trigraph resolved to backslash ??/
++y; // This is hidden if trigraph replacement is active
}

(void)printf("x=%i, y=%i\n", x, y); //21.6
}

extern int misra_5_1_extern_var_hides_var_x;
extern int misra_5_1_extern_var_hides_var_y; //5.1
int misra_5_1_var_hides_var________a; // 8.4
Expand Down
2 changes: 2 additions & 0 deletions cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5428,6 +5428,8 @@
<define name="Q_LOGGING_CATEGORY(name,...)" value=""/>
<define name="QT_FORWARD_DECLARE_CLASS(name)" value="class name;"/>
<define name="QT_FORWARD_DECLARE_STRUCT(name)" value="struct name;"/>
<define name="QT_VERSION_CHECK(major, minor, patch)" value="((major&lt;&lt;16)|(minor&lt;&lt;8)|(patch))"/>
<define name="QT_CONFIG(feature)" value="1"/>
<!-- https://doc.qt.io/qt-6/qqmlintegration-h-qtqml-proxy.html -->
<define name="QML_ADDED_IN_VERSION(MAJOR, MINOR)" value=""/>
<define name="QML_ANONYMOUS" value=""/>
Expand Down
2 changes: 2 additions & 0 deletions cfg/wxwidgets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
<operatorEqVarError>
</operatorEqVarError>
</type-checks>
<!-- https://github.com/wxWidgets/wxWidgets/blob/master/include/wx/version.h -->
<define name="wxCHECK_VERSION(major,minor,release)" value="1"/>
<!-- http://docs.wxwidgets.org/trunk/group__group__funcmacro__string.html#ga437ea6ba615b75dac8603e96ec864160 -->
<!-- #define wxT(string) -->
<define name="wxT(str)" value="str"/>
Expand Down
Loading