Page MenuHomeFreeBSD

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

Authored by rwatson on Mar 27 2017, 6:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 10, 6:54 PM
Unknown Object (File)
Sun, Mar 10, 6:51 PM
Unknown Object (File)
Sun, Mar 10, 6:51 PM
Unknown Object (File)
Sun, Mar 10, 6:51 PM
Unknown Object (File)
Sun, Mar 10, 6:51 PM
Unknown Object (File)
Sun, Mar 10, 6:51 PM
Unknown Object (File)
Sun, Mar 10, 6:51 PM
Unknown Object (File)
Thu, Mar 7, 9:08 PM
Subscribers

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

Event Timeline

This revision is now accepted and ready to land.Mar 27 2017, 6:34 PM

LGTM with a few nitpicks noted inline

contrib/less/charset.c
560

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

contrib/less/cmdbuf.c
1389โ€“1390

Hmm, this file has an "interesting" style.

1390โ€“1391

is this > 80 cols?

contrib/less/ifile.c
52

drop register?

contrib/less/main.c
335

drop register?

contrib/less/output.c
444

register

contrib/less/pattern.c
273

line length?

contrib/less/regexp.c
1052

register

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.

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

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

emaste added inline comments.
contrib/less/position.c
175

extra space?

contrib/less/regexp.c
817

comment indentation?

This revision is now accepted and ready to land.Mar 31 2017, 7:53 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
This revision is now accepted and ready to land.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
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.