Page MenuHomeFreeBSD

clang-format libc string functions imported from musl
AbandonedPublic

Authored by emaste on Sep 8 2020, 12:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 7 2024, 9:59 PM
Unknown Object (File)
Nov 7 2024, 9:56 PM
Unknown Object (File)
Oct 29 2024, 11:34 PM
Unknown Object (File)
Oct 17 2024, 6:28 PM
Unknown Object (File)
Oct 14 2024, 11:26 AM
Unknown Object (File)
Oct 12 2024, 11:11 PM
Unknown Object (File)
Oct 11 2024, 11:11 AM
Unknown Object (File)
Oct 8 2024, 5:31 AM
Subscribers

Details

Reviewers
None
Summary

We have adopted these and don't consider them 'contrib' code.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.
emaste added inline comments.
lib/libc/string/strcspn.c
31–32

splitting between the 1 and << seems confusing

I much prefer the formatted version, except perhaps for the BITOP macro.

We have adopted these functions; changes from musl, if any, would be manually applied if this change goes in.
OpenBSD also imported some musl string routines and reformatted them.

arichardson added inline comments.
lib/libc/string/strcspn.c
31–32

Seems like clang-format assumes that op( is a function call and then the formatting for the rest of the line is broken.
It might also like breaking before << because of LLVM's streaming I/O classes where that formatting does make sense.

(Original review to import these string functions was still open in D17630; we imported other musl string functions in rS315467, rS346054, rS351700)

strchr and strchrnul imported in 7f72497ef756ff7d03d5560c2d1c1f92f73fcb52, already formatted
strcspn was dropped from D17630