Project

General

Profile

Bug #11333

exstr: 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:

    exstr.c: In function 'replace':
    exstr.c:289:28: error: comparison between pointer and integer [-Werror]
       if (strcmp(repbuf, name) != NULL)
                                ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Dan McDonald 3 months ago

Part of this bug's cleanup was to remove some explicity-declarations of system functions like exit() and properly use stdlib.h. A side-effect of this is that the binary shrinks slightly in size since exit() in stdlib.h includes the does-not-return hint, which compilers use to eliminate useless return code. This makes reality-checking no change otherwise harder.

#2

Updated by Electric Monk 3 months ago

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

git commit bcc2c2b83b7fa504ab39a003964e07c06e7af053

commit  bcc2c2b83b7fa504ab39a003964e07c06e7af053
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-11T15:00:55.000Z

    11333 exstr: NULL pointer errors
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF