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)
Sat, Jun 1, 6:53 PM
Unknown Object (File)
May 12 2024, 8:31 PM
Unknown Object (File)
May 4 2024, 6:02 PM
Unknown Object (File)
May 2 2024, 7:43 AM
Unknown Object (File)
Jan 10 2024, 2:00 AM
Unknown Object (File)
Dec 10 2023, 10:44 PM
Unknown Object (File)
Nov 10 2023, 5:29 AM
Unknown Object (File)
Oct 9 2023, 4:17 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