Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit66d7f2b

Browse files
Don't report '//*comment' in RULE-3-1
1 parentdb1061e commit66d7f2b

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

‎c/misra/src/rules/RULE-3-1/CharacterSequencesAndUsedWithinAComment.ql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ where
4343
notisExcluded(comment, SyntaxPackage::characterSequencesAndUsedWithinACommentQuery())and
4444
(
4545
exists(IllegalCommentSequencec|illegalSequence=c|
46-
comment.getContents().indexOf(illegalSequence)>0
46+
comment.getContents().indexOf(illegalSequence)>1
4747
)
4848
or
4949
exists(IllegalCCommentRegexpc|illegalSequence=c.getDescription()|

‎c/misra/test/rules/RULE-3-1/CharacterSequencesAndUsedWithinAComment.expected‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
| test.c:21:1:21:7 | // /* | Comment contains an illegal sequence '/*' |
44
| test.c:30:1:30:27 | /* https://github.com // */ | Comment contains an illegal sequence '//' |
55
| test.c:33:1:33:60 | /* a://b, a://b., ://a.b, a://b., a://.b, ://, a://, ://b */ | Comment contains an illegal sequence '//' |
6+
| test.c:42:1:42:8 | ///* foo | Comment contains an illegal sequence '/*' |

‎c/misra/test/rules/RULE-3-1/test.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,10 @@
3535
// COMPLIANT
3636
// https://github.com
3737

38+
// COMPLIANT
39+
//* foo
40+
41+
// NON_COMPLIANT
42+
///* foo
43+
3844
voidf(){}

‎change_notes/2024-12-13-implement-misra-c-amendment4-rule-amendments.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
-`RULE-13-2` -`UnsequencedAtomicReads.ql`
88
- New query to find expressions which read an atomic variable more than once between sequence points, to address new case from MISRA-C 2012 Amendment 4.
99
-`RULE-3-1` -`CharacterSequencesAndUsedWithinAComment.ql`
10-
- Add exception allowing URLs inside of cpp-style`/* ... */` comments, in compliance with MISRA-C 2012 Amendment 4
10+
- Add exception allowing URLs inside of cpp-style`/* ... */` comments, in compliance with MISRA-C 2012 Amendment 4.
11+
- No longer report cases of`//*some comment` in this rule.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp