Project

General

Profile

Bug #11407

powertop: NULL pointer errors

Added by Toomas Soome 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                     from ../common/suggestions.c:40:
    ../common/suggestions.c: In function 'pt_sugg_as_root':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'pt_sugg_add' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../common/suggestions.c:271:53: note: in expansion of macro 'NULL'
          " for reducing system power consumption",  40, NULL, NULL,
                                                         ^~~~
    ../common/suggestions.c:66:1: note: expected 'char' but argument is of type 'void *'
     pt_sugg_add(char *text, int weight, char key, char *sb_msg, sugg_func_t *func)
     ^~~~~~~~~~~

    ../common/events.c: In function 'pt_events_walk':
    ../common/events.c:110:21: error: comparison between pointer and integer [-Werror]
       if (offender_addr != NULL && dtrace_lookup_by_addr(dtp,
                         ^~
    ../common/events.c:154:21: error: comparison between pointer and integer [-Werror]
       if (offender_addr != NULL && dtrace_lookup_by_addr(dtp,
                         ^~
    ../common/events.c:193:21: error: comparison between pointer and integer [-Werror]
       if (offender_addr != NULL && dtrace_lookup_by_addr(dtp,
                         ^~

    ../common/powertop.c: In function 'main':
    ../common/powertop.c:150:35: error: comparison between pointer and integer [-Werror]
        if (dump_count <= 0 || *endptr != NULL) {
                                       ^~
    ../common/powertop.c:166:16: error: comparison between pointer and integer [-Werror]
        if (*endptr != NULL || interval < 1 ||
                    ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit f795e601c9a38cf166450e0144ae15253a5c6705

commit  f795e601c9a38cf166450e0144ae15253a5c6705
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-26T05:31:32.000Z

    11407 powertop: NULL pointer errors
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF