make: error: control reaches end of non-void function
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.
Updated by Electric Monk almost 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit 2e8f3c34fd03c526f292a1c36c92adab187e7e92 Author: Toomas Soome <firstname.lastname@example.org> Date: 2018-07-09T16:33:58.000Z 9567 make: error: control reaches end of non-void function Reviewed by: Yuri Pankov <email@example.com> Reviewed by: Ken Mays <firstname.lastname@example.org> Approved by: Hans Rosenfeld <email@example.com>