From efb971f9df0a8f2ed908a19147ca7b0036b4515d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 8 Sep 2020 16:17:31 +0200 Subject: Fail travis CI on compiler warnings --- .travis.yml | 7 ++++++- darwin/DarwinProcessList.c | 1 - darwin/Platform.c | 4 ++-- freebsd/FreeBSDProcessList.c | 17 ++++++++++------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3e358de..b86e5103 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,9 @@ os: - linux - osx -script: ./autogen.sh && ./configure && make +script: + - ./autogen.sh + # clang might warn about C11 generic selections in isnan() + - CFLAGS=-Wno-c11-extensions ./configure --enable-werror + - make + - CFLAGS=-Wno-c11-extensions make distcheck DISTCHECK_CONFIGURE_FLAGS=--enable-werror diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index 39d99c15..dea82379 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -115,7 +115,6 @@ struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) { } ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { - size_t len; DarwinProcessList* this = xCalloc(1, sizeof(DarwinProcessList)); ProcessList_init(&this->super, Class(Process), usersTable, pidMatchList, userId); diff --git a/darwin/Platform.c b/darwin/Platform.c index a8ca45b2..1186fe04 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -263,11 +263,11 @@ char* Platform_getProcessEnv(pid_t pid) { mib[0] = CTL_KERN; mib[1] = KERN_PROCARGS2; mib[2] = pid; - size_t bufsz = argmax; + bufsz = argmax; if (sysctl(mib, 3, buf, &bufsz, 0, 0) == 0) { if (bufsz > sizeof(int)) { char *p = buf, *endp = buf + bufsz; - int argc = *(int*)p; + int argc = *(int*)(void*)p; p += sizeof(int); // skip exe diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c index 06e729c8..11cfe7e1 100644 --- a/freebsd/FreeBSDProcessList.c +++ b/freebsd/FreeBSDProcessList.c @@ -391,7 +391,7 @@ void ProcessList_goThroughEntries(ProcessList* this) { for (int i = 0; i < count; i++) { struct kinfo_proc* kproc = &kprocs[i]; bool preExisting = false; - bool isIdleProcess = false; + // TODO: bool isIdleProcess = false; struct tm date; Process* proc = ProcessList_getProcess(this, kproc->ki_pid, &preExisting, (Process_New) FreeBSDProcess_new); FreeBSDProcess* fp = (FreeBSDProcess*) proc; @@ -449,12 +449,15 @@ void ProcessList_goThroughEntries(ProcessList* this) { proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale); proc->percent_mem = 100.0 * (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem); - if (proc->percent_cpu > 0.1) { - // system idle process should own all CPU time left regardless of CPU count - if ( strcmp("idle", kproc->ki_comm) == 0 ) { - isIdleProcess = true; - } - } + /* + * TODO + * if (proc->percent_cpu > 0.1) { + * // system idle process should own all CPU time left regardless of CPU count + * if ( strcmp("idle", kproc->ki_comm) == 0 ) { + * isIdleProcess = true; + * } + * } + */ proc->priority = kproc->ki_pri.pri_level - PZERO; -- cgit v1.2.3