Bug #9374

svr4pkg: comparison between pointer and zero character constant

Added by Toomas Soome 11 months ago. Updated 9 months ago.

Status:ClosedStart date:2018-03-27
Priority:NormalDue date:
Assignee:Toomas Soome% Done:

100%

Category:cmd - userland programs
Target version:-
Difficulty:Medium Tags:

Description

Issues found by gcc 7 build:

    svr4pkg: comparison between pointer and zero character constant

    pkgops.c: In function 'pkgTestInstalled':
    pkgops.c:1156:20: error: comparison between pointer and zero character const
ant [-Werror=pointer-compare]
      assert(a_rootPath != '\0');
                        ^
    /code/illumos-gate/proto/root_i386/usr/include/assert.h:78:28: note: in defi
nition of macro 'assert'
     #define assert(EX) (void)((EX) || (__assert(#EX, __FILE__, __LINE__), 0))
                                ^~
    pkgops.c:1156:9: note: did you mean to dereference the pointer?
      assert(a_rootPath != '\0');
             ^
    /code/illumos-gate/proto/root_i386/usr/include/assert.h:78:28: note: in definition of macro 'assert'
     #define assert(EX) (void)((EX) || (__assert(#EX, __FILE__, __LINE__), 0))
                                ^~
    cc1: all warnings being treated as errors

    pkgcond: comparison between pointer and zero character constant

    main.c: In function 'resolvePath':
    main.c:3465:14: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (*r_path == '\0') {
                  ^~
    main.c:3465:6: note: did you mean to dereference the pointer?
      if (*r_path == '\0') {
          ^
    cc1: all warnings being treated as errors

History

#1 Updated by Electric Monk 9 months ago

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

git commit c7a0678d54bbc87f507a8909a193f75cbb463ede

commit  c7a0678d54bbc87f507a8909a193f75cbb463ede
Author: Toomas Soome <tsoome@me.com>
Date:   2018-05-16T10:02:58.000Z

    9374 svr4pkg: comparison between pointer and zero character constant
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

Also available in: Atom