Project

General

Profile

Actions

Bug #9169

closed

libsldap: comparison between pointer and zero character constant

Added by Toomas Soome over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2018-02-22
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Issue found by gcc 7 build:

    ../common/ns_crypt.c:101:19: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
       if (++anHexaStr != '\0') {
                       ^~
    ../common/ns_crypt.c:101:7: note: did you mean to dereference the pointer?
       if (++anHexaStr != '\0') {
           ^~

    ../common/ns_writes.c: In function '__s_cvt_hosts':
    ../common/ns_writes.c:2035:54: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
          ptr->h_addr_list == NULL || ptr->h_addr_list[0] == '\0') {
                                                          ^~
    ../common/ns_writes.c:2035:34: note: did you mean to dereference the pointer?
          ptr->h_addr_list == NULL || ptr->h_addr_list[0] == '\0') {
                                      ^
    ../common/ns_writes.c: In function '__s_cvt_services':
    ../common/ns_writes.c:2347:61: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (ptr->s_name == NULL || ptr->s_port < 0 || ptr->s_proto == '\0') {
                                                                 ^~
    ../common/ns_writes.c:2347:48: note: did you mean to dereference the pointer?
      if (ptr->s_name == NULL || ptr->s_port < 0 || ptr->s_proto == '\0') {
                                                    ^
    ../common/ns_writes.c: In function '__s_cvt_netmasks':
    ../common/ns_writes.c:2561:19: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (ptr->netmask != '\0') {
                       ^~
    ../common/ns_writes.c:2561:6: note: did you mean to dereference the pointer?
      if (ptr->netmask != '\0') {
          ^
    ../common/ns_writes.c: In function '__s_cvt_netgroups':
    ../common/ns_writes.c:2619:16: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (ptr->name != '\0') {
                    ^~
    ../common/ns_writes.c:2619:6: note: did you mean to dereference the pointer?
      if (ptr->name != '\0') {
          ^
    ../common/ns_writes.c: In function '__s_cvt_bootparams':
    ../common/ns_writes.c:2718:16: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (ptr->name != '\0') {
                    ^~
    ../common/ns_writes.c:2718:6: note: did you mean to dereference the pointer?
      if (ptr->name != '\0') {
          ^
    ../common/ns_writes.c: In function '__s_cvt_ethers':
    ../common/ns_writes.c:2782:38: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (ptr->name == NULL || ptr->ether == '\0') {
                                          ^~
    ../common/ns_writes.c:2782:27: note: did you mean to dereference the pointer?
      if (ptr->name == NULL || ptr->ether == '\0') {
                               ^
    cc1: all warnings being treated as errors

Actions

Also available in: Atom PDF