9367 troff: comparison between pointer and zero character constant

Review Request #1010 - Created March 27, 2018 and updated

Information
Toomas Soome
illumos-gate
9367
247f146...
Reviewers
general
../n1.c: In function 'main':
../n1.c:148:17: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
     if (argv[0] != '\0') {
                 ^~
../n1.c:148:9: note: did you mean to dereference the pointer?
     if (argv[0] != '\0') {
         ^
../n1.c:184:20: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
    if (&argv[0][2] != '\0' && strlen(&argv[0][2]) >= 2 && &argv[0][3] != '\0')
                    ^~
../n1.c:184:8: note: did you mean to dereference the pointer?
    if (&argv[0][2] != '\0' && strlen(&argv[0][2]) >= 2 && &argv[0][3] != '\0')
        ^
../n1.c:184:71: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
    if (&argv[0][2] != '\0' && strlen(&argv[0][2]) >= 2 && &argv[0][3] != '\0')
                                                                       ^~
../n1.c:184:59: note: did you mean to dereference the pointer?
    if (&argv[0][2] != '\0' && strlen(&argv[0][2]) >= 2 && &argv[0][3] != '\0')
                                                           ^
../n1.c:201:28: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
    if (getenv("TROFFMACS") != '\0') {
                            ^~
../n1.c:201:8: note: did you mean to dereference the pointer?
    if (getenv("TROFFMACS") != '\0') {
        ^
cc1: all warnings being treated as errors

  

Issues

  • 0
  • 1
  • 1
  • 2
Description From Last Updated
Yuri Pankov
Toomas Soome
Andy Fiddaman
Andy Fiddaman
Toomas Soome
Toomas Soome
Review request changed

Commit:

-571ac19789b12afb471785e7ce16b1cb815162e4
+247f1460c284423603919b6db14f4fd973f879b8

Diff:

Revision 4 (+9 -10)

Show changes

Hans Rosenfeld
Ship It!
Loading...