-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathCompilerLanguageExtensionsUsed.ql
More file actions
27 lines (25 loc) · 1.04 KB
/
CompilerLanguageExtensionsUsed.ql
File metadata and controls
27 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* @id cpp/misra/compiler-language-extensions-used
* @name RULE-4-1-1: A program shall conform to ISO/IEC 14882:2017 (C++17)
* @description Language extensions are compiler-specific features that are not part of the C++17
* standard. Using these extensions reduces portability and may lead to unpredictable
* behavior when code is compiled with different compilers or compiler versions.
* @kind problem
* @precision high
* @problem.severity error
* @tags external/misra/id/rule-4-1-1
* scope/system
* maintainability
* portability
* external/misra/enforcement/undecidable
* external/misra/obligation/required
*/
import cpp
import codingstandards.cpp.misra
import codingstandards.cpp.Extensions
import codingstandards.cpp.AlertReporting
from Element unwrapped, CPPCompilerExtension e
where
not isExcluded([e, unwrapped], Toolchain2Package::compilerLanguageExtensionsUsedQuery()) and
unwrapped = MacroUnwrapper<CPPCompilerExtension>::unwrapElement(e)
select unwrapped, e.getMessage()