DaveGamble/cJSON

warning: 'sscanf' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtod' instead [cert-err34-c]

ClausKlein opened this issue · 0 comments

/usr/local/opt/llvm/bin/clang-tidy -checks=-*,cert-* -p=build /Users/clausklein/Workspace/c/tests/cJSON-src/test.c
4618 warnings generated.
Suppressed 4618 warnings (4618 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
/usr/local/opt/llvm/bin/clang-tidy -checks=-*,cert-* -p=build /Users/clausklein/Workspace/c/tests/cJSON-src/cJSON.c
/Users/clausklein/Workspace/c/tests/cJSON-src/cJSON.c:583:14: warning: 'sscanf' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtod' instead [cert-err34-c]
  583 |         if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d))
      |              ^
5033 warnings generated.
Suppressed 5032 warnings (5032 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
bash-5.2$