Skip to contentSkip to conversation

bcmp: note that this function is no longer legacy due to LLVM 9

PATCH In review Shawn Landden 2 participants 2 messages Jan 11, 2020 – Jan 17, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcmp: note that this function is no longer legacy due to LLVM 9

---
 man3/bcmp.3 | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
man3/bcmp.3 +9 -3
index ba9838019..18d238720 100644
@@ -70,15 +70,21 @@ T{
 .BR bcmp ()
 T}	Thread safety	MT-Safe
 .TE
 .SH CONFORMING TO
 4.3BSD.
-This function is deprecated (marked as LEGACY in POSIX.1-2001): use
-.BR memcmp (3)
-in new programs.
+This function was deprecated (marked as LEGACY) by POSIX.1-2001).
 POSIX.1-2008 removes the specification of
 .BR bcmp ().
+LLVM 9, released in 2019, revived
+.BR bcmp ()
+and generates calls to it instead of
+.BR memcmp (3)
+as appropiate as an optimization (as
+.BR bcmp ()
+need not traverse memory in-order).
+.\" http://releases.llvm.org/9.0.0/docs/ReleaseNotes.html#noteworthy-optimizations
 .SH SEE ALSO
 .BR bstring (3),
 .BR memcmp (3),
 .BR strcasecmp (3),
 .BR strcmp (3),
Signature · 1 line
2.20.1
#1 lore raw

* Shawn Landden:

man3/bcmp.3 T{ · line 85

Quoted 11 lines
man3/bcmp.3 +9 -0
+This function was deprecated (marked as LEGACY) by POSIX.1-2001).
 POSIX.1-2008 removes the specification of
 .BR bcmp ().
+LLVM 9, released in 2019, revived
+.BR bcmp ()
+and generates calls to it instead of
+.BR memcmp (3)
+as appropiate as an optimization (as
+.BR bcmp ()
+need not traverse memory in-order).
+.\" http://releases.llvm.org/9.0.0/docs/ReleaseNotes.html#noteworthy-optimizations

This is a pessimation on GNU/Linux if the program uses memcmp as well because it introduces another relocation.

Thanks,
Florian