Skip to content

Commit 8aee471

Browse files
committed
formatting
1 parent def0893 commit 8aee471

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

c/common/src/codingstandards/c/Extensions.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import cpp
22
import codingstandards.cpp.Extensions
33

44
/**
5-
* Common base class for modeling compiler extensions.
5+
* Common base class for modeling compiler extensions.
66
*/
77
abstract class CCompilerExtension extends CompilerExtension { }
88

@@ -69,7 +69,7 @@ class CFunctionLikeExtension extends CCompilerExtension, AlignofExprOperator {
6969
}
7070

7171
// Reference: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement-Exprs
72-
class CStmtExprExtension extends CCompilerExtension, StmtExpr {}
72+
class CStmtExprExtension extends CCompilerExtension, StmtExpr { }
7373

7474
// Use of ternary like the following: `int a = 0 ?: 0;` where the
7575
// one of the branches is omitted
@@ -88,8 +88,9 @@ class CRealTypeExtensionExtension extends CCompilerExtension, RealNumberType {
8888
this instanceof Float128Type
8989
}
9090
}
91+
9192
// Reference: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html#g_t_005f_005fint128
92-
class CIntegerTypeExtension extends CCompilerExtension, Int128Type {}
93+
class CIntegerTypeExtension extends CCompilerExtension, Int128Type { }
9394

9495
class CZeroLengthArraysExtension extends CCompilerExtension, DeclarationEntry {
9596
CZeroLengthArraysExtension() { getType().(ArrayType).getArraySize() = 0 }

c/misra/src/rules/RULE-1-2/LanguageExtensionsShouldNotBeUsed.ql

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
* readability
1111
* external/misra/obligation/advisory
1212
*/
13-
import cpp
14-
import codingstandards.c.misra
15-
import codingstandards.c.Extensions
1613

17-
from CCompilerExtension e
18-
where
19-
not isExcluded(e, Language3Package::languageExtensionsShouldNotBeUsedQuery())
20-
select e, "Is a compiler extension and is not portable to other compilers."
14+
import cpp
15+
import codingstandards.c.misra
16+
import codingstandards.c.Extensions
2117

18+
from CCompilerExtension e
19+
where not isExcluded(e, Language3Package::languageExtensionsShouldNotBeUsedQuery())
20+
select e, "Is a compiler extension and is not portable to other compilers."
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import cpp
1+
import cpp
22

3-
abstract class CompilerExtension extends Locatable {}
4-
abstract class CPPCompilerExtension extends CompilerExtension {}
3+
/**
4+
* Common base class for modeling compiler extensions.
5+
*/
6+
abstract class CompilerExtension extends Locatable { }
7+
8+
/**
9+
* Common base class for modeling compiler extensions in CPP.
10+
*/
11+
abstract class CPPCompilerExtension extends CompilerExtension { }

0 commit comments

Comments
 (0)