Skip to content

Commit

Permalink
fix macos compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsaou committed Mar 19, 2023
1 parent 95f866a commit 8a1d24e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ else
fi
AC_MSG_RESULT([${with_math}])

AC_CHECK_DECLS(isfinite,,,[#include <math.h>])
AC_CHECK_FUNCS([isfinite])
AC_CHECK_FUNCS([finite])

Expand Down
2 changes: 1 addition & 1 deletion libnetdata/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ long get_system_cpus_with_cache(bool cache, bool for_netdata) {
processors[index] = 1;

if(error)
error("Assuming system has %d processors.", processors[index]);
error("Assuming system has %ld processors.", processors[index]);
}

return processors[index];
Expand Down
2 changes: 1 addition & 1 deletion libnetdata/storage_number/storage_number.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bool is_system_ieee754_double(void) {

if(*ptr != tests[i].i && (tests[i].original == tests[i].d || (isnan(tests[i].original) && isnan(tests[i].d)))) {
if(!logged)
info("IEEE754: test #%zu, value " NETDATA_DOUBLE_FORMAT_G " is represented in this system as %lX, but it was expected as %lX",
info("IEEE754: test #%zu, value " NETDATA_DOUBLE_FORMAT_G " is represented in this system as %llX, but it was expected as %llX",
i+1, tests[i].original, *ptr, tests[i].i);
errors++;
}
Expand Down
2 changes: 1 addition & 1 deletion libnetdata/storage_number/storage_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef long long collected_number;
#define epsilonndd (NETDATA_DOUBLE)0.0000001
#define considered_equal_ndd(a, b) (fabsndd((a) - (b)) < epsilonndd)

#if defined(HAVE_ISFINITE) || defined(isfinite)
#if defined(HAVE_DECL_ISFINITE) || defined(HAVE_ISFINITE) || defined(isfinite)
// The isfinite() macro shall determine whether its argument has a
// finite value (zero, subnormal, or normal, and not infinite or NaN).
#define netdata_double_isnumber(a) (isfinite(a))
Expand Down

0 comments on commit 8a1d24e

Please sign in to comment.