Project

General

Profile

Bug #9567

make: error: control reaches end of non-void function

Added by Toomas Soome about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2018-05-31
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

issue found by gcc 8 build:

        /code/illumos-gate/usr/src/cmd/make/bin/ar.cc: In function 'Boolean read_archive_dir(Ar*, Name, char**)':
        /code/illumos-gate/usr/src/cmd/make/bin/ar.cc:546:1: error: control reaches end of non-void function [-Werror=return-type]
         }

        /code/illumos-gate/usr/src/cmd/make/bin/doname.cc: In function 'Doname doname_check(Name, Boolean, Boolean, Boolean)':
        /code/illumos-gate/usr/src/cmd/make/bin/doname.cc:181:1: error: control reaches end of non-void function [-Werror=return-type]
         }
         ^
        cc1plus: all warnings being treated as errors

There is a reasonable doubt about how reliable the diagnostics from the gcc 8 is; however, as the current code in doname.cc is also using "special" workaround for lint, IMO the best action is to provide the proper return statement and to avoid any kind of hacks to outsmart the compiler or lint.

History

#1

Updated by Toomas Soome about 2 years ago

  • Description updated (diff)
#2

Updated by Electric Monk almost 2 years ago

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

git commit 2e8f3c34fd03c526f292a1c36c92adab187e7e92

commit  2e8f3c34fd03c526f292a1c36c92adab187e7e92
Author: Toomas Soome <tsoome@me.com>
Date:   2018-07-09T16:33:58.000Z

    9567 make: error: control reaches end of non-void function
    Reviewed by: Yuri Pankov <yuripv@yuripv.net>
    Reviewed by: Ken Mays <kmays2000@gmail.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

Also available in: Atom PDF