Page MenuHomeFreeBSD

Use contemporary C function prototypes with less(1).
ClosedPublic

Authored by rwatson on Mar 27 2017, 6:28 PM.

Details

Summary

Currently, less(1) uses K&R prototypes, which both fails to provide useful
compiler-time type checking, and also causes problems for targets where
multiple incompatible calling conventions may be selected based on argument
types. This change switches less(1) to ANSI prototypes.

Test Plan

Tested at SRI and Cambridge in CheriBSD.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rwatson created this revision.Mar 27 2017, 6:28 PM
cem accepted this revision.Mar 27 2017, 6:34 PM
This revision is now accepted and ready to land.Mar 27 2017, 6:34 PM
emaste accepted this revision.Mar 27 2017, 6:57 PM

LGTM with a few nitpicks noted inline

contrib/less/charset.c
560 ↗(On Diff #26698)

Ick, hopefully we can convince upstream to drop the #define constant const and just use const.

contrib/less/cmdbuf.c
1389 ↗(On Diff #26698)

Hmm, this file has an "interesting" style.

1390 ↗(On Diff #26698)

is this > 80 cols?

contrib/less/ifile.c
52 ↗(On Diff #26698)

drop register?

contrib/less/main.c
335 ↗(On Diff #26698)

drop register?

contrib/less/output.c
444 ↗(On Diff #26698)

register

contrib/less/pattern.c
273 ↗(On Diff #26698)

line length?

contrib/less/regexp.c
1052 ↗(On Diff #26698)

register

rwatson updated this revision to Diff 26745.Mar 28 2017, 11:24 PM
rwatson edited edge metadata.

Further updates to constant use in less(1) using a more recent LLVM.

This revision now requires review to proceed.Mar 28 2017, 11:24 PM

Additional changes LGTM, still line length & register nits.

rwatson updated this revision to Diff 26890.Mar 31 2017, 7:24 PM

Line wrap two overlong lines (with new type information) to 80 characters.

Remove all instances of "register". (There were a lot of these!)

emaste accepted this revision.Mar 31 2017, 7:53 PM
emaste added inline comments.
contrib/less/position.c
175 ↗(On Diff #26890)

extra space?

contrib/less/regexp.c
817 ↗(On Diff #26890)

comment indentation?

This revision is now accepted and ready to land.Mar 31 2017, 7:53 PM
rwatson updated this revision to Diff 26891.Mar 31 2017, 7:56 PM
rwatson edited edge metadata.

Catch a couple of further instances of K&R prototypes not caught by current
compiler warnings.

This revision now requires review to proceed.Mar 31 2017, 7:56 PM
emaste accepted this revision.Mar 31 2017, 7:59 PM
This revision is now accepted and ready to land.Mar 31 2017, 7:59 PM
rwatson updated this revision to Diff 26892.Mar 31 2017, 7:59 PM
rwatson edited edge metadata.

Two whitespace fixes requested by @emaste.

This revision now requires review to proceed.Mar 31 2017, 7:59 PM
emaste accepted this revision.Mar 31 2017, 8:09 PM
This revision is now accepted and ready to land.Mar 31 2017, 8:09 PM
This revision was automatically updated to reflect the committed changes.