Skip to content

Commit

Permalink
Add basic rule description
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-joly-sonarsource committed Nov 14, 2024
1 parent 4570280 commit 17f3f2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
1 change: 1 addition & 0 deletions rules/S2253/cfamily/metadata.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"title": "User-specified functions should not be called"
}
49 changes: 12 additions & 37 deletions rules/S2253/cfamily/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,44 +1,19 @@
FIXME: add a description
This rule template allows to define rules that ban the call of some functions, for instance functions provided for legacy reasons. It will not prevent calling member functions or macros with the same name.

// If you want to factorize the description uncomment the following line and create the file.
//include::../description.adoc[]
=== Noncompliant code example

== Why is this an issue?
Given parameters:

FIXME: remove the unused optional headers (that are commented out)
* names: f1, ::f2
* message: Don't call $

//=== What is the potential impact?

== How to fix it
//== How to fix it in FRAMEWORK NAME

=== Code examples

==== Noncompliant code example

[source,cpp,diff-id=1,diff-type=noncompliant]
----
FIXME
----

==== Compliant solution

[source,cpp,diff-id=1,diff-type=compliant]
[source,cpp]
----
FIXME
void f() {
f1(); // Noncompliant: Don't call f1
my::f1(); // Noncompliant: Don't call f1
f2(); // Noncompliant: Don't call f2
my::f2() // Compliant
}
----

//=== How does this work?

//=== Pitfalls

//=== Going the extra mile


//== Resources
//=== Documentation
//=== Articles & blog posts
//=== Conference presentations
//=== Standards
//=== External coding guidelines
//=== Benchmarks

0 comments on commit 17f3f2c

Please sign in to comment.