From owner-freebsd-questions@FreeBSD.ORG Wed Mar 11 13:44:59 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7716FCC3 for ; Wed, 11 Mar 2015 13:44:59 +0000 (UTC) Received: from smtp5.hushmail.com (smtp5.hushmail.com [65.39.178.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.hushmail.com", Issuer "smtp.hushmail.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A093DCA for ; Wed, 11 Mar 2015 13:44:59 +0000 (UTC) Received: from smtp5.hushmail.com (localhost [127.0.0.1]) by smtp5.hushmail.com (Postfix) with SMTP id CD88B60317 for ; Wed, 11 Mar 2015 13:44:58 +0000 (UTC) Received: from smtp.hushmail.com (w3.hushmail.com [65.39.178.62]) by smtp5.hushmail.com (Postfix) with ESMTP for ; Wed, 11 Mar 2015 13:44:58 +0000 (UTC) Received: by smtp.hushmail.com (Postfix, from userid 99) id AF7B8C0450; Wed, 11 Mar 2015 13:44:58 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 11 Mar 2015 13:44:58 +0000 To: freebsd-questions@freebsd.org Subject: Compiling cpulimit: warning: implicit declaration of function 'basename' From: opendaddy@hushmail.com In-Reply-To: <20150311141347.1013d42d.freebsd@edvax.de> References: <20150311122656.96F2020341@smtp.hushmail.com> <20150311141347.1013d42d.freebsd@edvax.de> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" Message-Id: <20150311134458.AF7B8C0450@smtp.hushmail.com> X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 13:44:59 -0000 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.