File tree 4 files changed +13
-18
lines changed
common/src/codingstandards/c
4 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 1
-
2
1
import cpp
3
2
4
3
private string getATgMathMacroName ( boolean allowComplex ) {
@@ -35,21 +34,17 @@ class TgMathInvocation extends MacroInvocation {
35
34
}
36
35
37
36
Expr getOperandArgument ( int i ) {
38
- result = call .getArgument ( i )
39
- and not hasOutputArgument ( call .getTarget ( ) .getName ( ) , i )
37
+ result = call .getArgument ( i ) and
38
+ not hasOutputArgument ( call .getTarget ( ) .getName ( ) , i )
40
39
}
41
40
42
41
int getNumberOfOperandArguments ( ) {
43
42
result = call .getNumberOfArguments ( ) - count ( int i | hasOutputArgument ( getMacroName ( ) , i ) )
44
43
}
45
44
46
- Expr getAnOperandArgument ( ) {
47
- result = getOperandArgument ( _)
48
- }
45
+ Expr getAnOperandArgument ( ) { result = getOperandArgument ( _) }
49
46
50
- predicate allowsComplex ( ) {
51
- allowComplex = true
52
- }
47
+ predicate allowsComplex ( ) { allowComplex = true }
53
48
}
54
49
55
50
private Call getACallInExpansion ( MacroInvocation mi ) { result = mi .getAnExpandedElement ( ) }
@@ -65,4 +60,4 @@ private Call getBestCallInExpansion(MacroInvocation mi) {
65
60
or
66
61
count ( getNameMatchedCallInExpansion ( mi ) ) > 1 and
67
62
result = rank [ 1 ] ( Call c | c = getACallInExpansion ( mi ) | c order by c .getTarget ( ) .getName ( ) )
68
- }
63
+ }
Original file line number Diff line number Diff line change 1
1
/**
2
2
* @id c/misra/tg-math-argument-with-invalid-essential-type
3
- * @name RULE-21-22: All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential
3
+ * @name RULE-21-22: All operand arguments to type-generic macros in <tgmath.h> shall have an appropriate essential type
4
4
* @description All operand arguments to any type-generic macros in <tgmath.h> shall have an
5
- * appropriate essential type
5
+ * appropriate essential type.
6
6
* @kind problem
7
7
* @precision high
8
8
* @problem.severity error
Original file line number Diff line number Diff line change 1
1
/**
2
2
* @id c/misra/tg-math-arguments-with-differing-standard-type
3
- * @name RULE-21-23: All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same
3
+ * @name RULE-21-23: Operand arguments for an invocation of a type-generic macro shall have the same standard type
4
4
* @description All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall
5
- * have the same standard type
5
+ * have the same standard type.
6
6
* @kind problem
7
7
* @precision high
8
8
* @problem.severity error
Original file line number Diff line number Diff line change 6
6
},
7
7
"queries" : [
8
8
{
9
- "description" : " All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential type" ,
9
+ "description" : " All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential type. " ,
10
10
"kind" : " problem" ,
11
- "name" : " All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential" ,
11
+ "name" : " All operand arguments to type-generic macros in <tgmath.h> shall have an appropriate essential type " ,
12
12
"precision" : " high" ,
13
13
"severity" : " error" ,
14
14
"short_name" : " TgMathArgumentWithInvalidEssentialType" ,
29
29
},
30
30
"queries" : [
31
31
{
32
- "description" : " All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same standard type" ,
32
+ "description" : " All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same standard type. " ,
33
33
"kind" : " problem" ,
34
- "name" : " All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same" ,
34
+ "name" : " Operand arguments for an invocation of a type-generic macro shall have the same standard type " ,
35
35
"precision" : " high" ,
36
36
"severity" : " error" ,
37
37
"short_name" : " TgMathArgumentsWithDifferingStandardType" ,
You can’t perform that action at this time.
0 commit comments