Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/tools/clang-tidy/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 633 B image not shown  

Quelle  bugprone-swapped-arguments.cpp   Sprache: C

 
// https://clang.llvm.org/extra/clang-tidy/checks/bugprone-swapped-arguments.html

void test_d_i(double d, int i);
void test_d_i_i(double d, int i, int ii);
void test_i_d(int i, double d);
void test_i_i_d(int i, int ii, double d);

void test()
{
  double d = 1;
  int i = 1;

  test_d_i(d, i); // OK
  test_d_i(i, d); // WARNING

  test_i_d(i, d); // OK
  test_i_d(d, i); // WARNING

  test_i_i_d(i, i, d); // OK
  test_i_i_d(i, d, i); // WARNING
  test_i_i_d(d, i, i); // NO WARNING after second parameter

  test_d_i_i(d, i, i); // OK
  test_d_i_i(i, d, i); // WARNING
  test_d_i_i(i, i, d); // NO WARNING after second parameter
}

Messung V0.5
C=58 H=100 G=81

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.