Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions rules/S8230/cfamily/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"title": "MSVC-specific extensions should not be used",
"type": "CODE_SMELL",
"status": "ready",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "5min"
},
"tags": [
"lock-in"
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-8230",
"sqKey": "S8230",
"scope": "All",
"defaultQualityProfiles": [],
"quickfix": "infeasible",
"code": {
"impacts": {
"MAINTAINABILITY": "LOW"
},
"attribute": "CONVENTIONAL"
}
}
23 changes: 23 additions & 0 deletions rules/S8230/cfamily/rule.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MSVC-specific extensions should not be used

== Why is this an issue?

Proprietary compiler extensions can be handy, but they commit you to always using that compiler. This rule raises an issue when MSVC-specific extensions are used. Other compilers will reject such code, making it non-portable. Keeping code standard-conforming ensures consistency across different compilers and platforms.

== How to fix it

Replace MSVC-specific extensions with standard-conforming alternatives.

//=== Code examples
//
//Code examples will be added here.

== Resources

=== Related rules

* S8216 - Code should not rely on features beyond the configured {cpp} standard
* S3715 - GNU extensions should not be used
* S8231 - Non-standard attributes should not be used
* S4263 reports uses of MSVC-specific include file search strategy
* S2260 tracks parsing failures and can help identify compiler-specific extensions that the analyzer fails to recognize
2 changes: 2 additions & 0 deletions rules/S8230/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}