Tarsnap / tarsnap

Command-line client code for Tarsnap.
https://tarsnap.com
Other
865 stars 60 forks source link

build: The <sys/sysctl.h> header is deprecated #523

Open gperciva opened 2 years ago

gperciva commented 2 years ago

Compiling tarsnap on modern GNU/Linux systems leads to this warning (or error, depending on compiler flags):

In file included from ../lib-platform/util/memlimit.c:43:
/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: error: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror=cpp]
   21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
      |  ^~~~~~~

That's not a problem, because that part of lib-platform/util/memlimit.c is:

#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif

In other words, when <sys/sysctl.h> is removed, we won't try to include it.

I'm leaving this github issue open so that it's visible in case anybody else encounters this message and investigates.