#10 Fixes to warnings produced by Nevada compiler

Bug fix (11)

Originally submitted by Klaus Ziegler

I've downloaded top-3.6beta4 and used Sun Studio 11
compilers on Solaris Nevada build 27a/x86 to build top.
First build log is included in initial_build.bz2.
Using gcc (3.4.3) which comes with Solaris Nevada does
not issue any warrning at all. I then went trough all
the warrnings using Studio11 and fixed them. Then, I
re-checked with gcc for warrnings - none !
attached file top-3.6-patch.bz2 - have fun, please
let me know if you integrate the fixes.

Rgds Klaus


  • William LeFebvre

    patch to fix warning messages

  • William LeFebvre

    • status: open --> closed-accepted
  • William LeFebvre

    Logged In: YES

    I've looked through the changes in the patch, accepted some
    and implemented others in a different way:

    m_sunos5.c: get_cpustats((unsigned int*)&cpus, cp_stats);
    Instead I changed the first argument of get_cpustats to be
    an int * to match its usage. There's really no need for it
    to be unsigned.

    os.h: there's got to be a better way to include unistd.h
    where it is needed (like maybe test for it at configure
    time), but your patch will do for now.

    color.c: "void error_message" template.
    I created the include file message.h that contains only
    templates for the message functions, including
    error_message. That's now included in color.c

    top.c: "void color_dump();" call.
    Oops! That's a debug call and shouldn't even be in there!
    I just removed it.


Log in to post a comment.