== Why is this an issue?

Comparing two identical strings will always yield the same result and doesn't achieve anything. This is likely to be made in error.


This rule raises an issue when ``++strcmp++`` or ``++strncmp++`` is called with two identical literal strings or twice the same variable.


=== Noncompliant code example

[source,cpp]
----
if (strcmp("F00", "F00")) { // Noncompliant
  doSomething();
}
if (strncmp(s1, s1, 10)) { // Noncompliant
  doSomethingElse();
}
----


ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Review this comparison, both strings are identical.


=== Highlighting

The full strcmp call


endif::env-github,rspecator-view[]
