Date: Wed, 11 Mar 2015 13:44:58 +0000 From: opendaddy@hushmail.com To: freebsd-questions@freebsd.org Subject: Compiling cpulimit: warning: implicit declaration of function 'basename' Message-ID: <20150311134458.AF7B8C0450@smtp.hushmail.com> In-Reply-To: <20150311141347.1013d42d.freebsd@edvax.de> References: <20150311122656.96F2020341@smtp.hushmail.com> <20150311141347.1013d42d.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi! Anybody know how to fix these cpulimit (https://github.com/opsengine/cpulimit/) build warnings? They seem to make cpulimit prevent processes from getting more than 2% CPU. # gmake cd src && gmake all gmake[1]: Entering directory '/root/cpulimit/src' cc -c list.c -Wall -g -D_GNU_SOURCE cc -c process_iterator.c -Wall -g -D_GNU_SOURCE cc -c process_group.c -Wall -g -D_GNU_SOURCE process_group.c:64:15: warning: implicit declaration of function 'basename' is invalid in C99 [-Wimplicit-function-declaration] if (strncmp(basename(proc.command), process_name, str... ^ process_group.c:64:15: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion] if (strncmp(basename(proc.command), process_name, str... ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/string.h:100:26: note: passing argument to parameter here int strncmp(const char *, const char *, size_t) __pure; ^ 2 warnings generated. cc -o cpulimit cpulimit.c list.o process_iterator.o process_group.o -lkvm -Wall -g -D_GNU_SOURCE gmake[1]: Leaving directory '/root/cpulimit/src' cd tests && gmake all gmake[1]: Entering directory '/root/cpulimit/tests' cc -o busy busy.c -lpthread -Wall -g cc -I../src -o process_iterator_test process_iterator_test.c ../src/list.o ../src/process_iterator.o ../src/process_group.o -lkvm -lpthread -Wall -g gmake[1]: Leaving directory '/root/cpulimit/tests' Thanks! O.D.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150311134458.AF7B8C0450>