File tree Expand file tree Collapse file tree 4 files changed +13
-18
lines changed
common/src/codingstandards/c Expand file tree Collapse file tree 4 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 1-
21import cpp
32
43private string getATgMathMacroName ( boolean allowComplex ) {
@@ -35,21 +34,17 @@ class TgMathInvocation extends MacroInvocation {
3534 }
3635
3736 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 )
4039 }
4140
4241 int getNumberOfOperandArguments ( ) {
4342 result = call .getNumberOfArguments ( ) - count ( int i | hasOutputArgument ( getMacroName ( ) , i ) )
4443 }
4544
46- Expr getAnOperandArgument ( ) {
47- result = getOperandArgument ( _)
48- }
45+ Expr getAnOperandArgument ( ) { result = getOperandArgument ( _) }
4946
50- predicate allowsComplex ( ) {
51- allowComplex = true
52- }
47+ predicate allowsComplex ( ) { allowComplex = true }
5348}
5449
5550private Call getACallInExpansion ( MacroInvocation mi ) { result = mi .getAnExpandedElement ( ) }
@@ -65,4 +60,4 @@ private Call getBestCallInExpansion(MacroInvocation mi) {
6560 or
6661 count ( getNameMatchedCallInExpansion ( mi ) ) > 1 and
6762 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 11/**
22 * @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
44 * @description All operand arguments to any type-generic macros in <tgmath.h> shall have an
5- * appropriate essential type
5+ * appropriate essential type.
66 * @kind problem
77 * @precision high
88 * @problem.severity error
Original file line number Diff line number Diff line change 11/**
22 * @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
44 * @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.
66 * @kind problem
77 * @precision high
88 * @problem.severity error
Original file line number Diff line number Diff line change 66 },
77 "queries" : [
88 {
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. " ,
1010 "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 " ,
1212 "precision" : " high" ,
1313 "severity" : " error" ,
1414 "short_name" : " TgMathArgumentWithInvalidEssentialType" ,
2929 },
3030 "queries" : [
3131 {
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. " ,
3333 "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 " ,
3535 "precision" : " high" ,
3636 "severity" : " error" ,
3737 "short_name" : " TgMathArgumentsWithDifferingStandardType" ,
You can’t perform that action at this time.
0 commit comments