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)
Wed, Sep 24, 1:05 PM
Unknown Object (File)
Sep 12 2025, 11:02 PM
Unknown Object (File)
Sep 11 2025, 4:21 PM
Unknown Object (File)
Sep 10 2025, 1:31 PM
Unknown Object (File)
Sep 9 2025, 11:24 PM
Unknown Object (File)
Sep 4 2025, 3:39 PM
Unknown Object (File)
Sep 4 2025, 8:28 AM
Unknown Object (File)
Aug 28 2025, 12:04 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