A NOTE has been added to this issue. ====================================================================== https://www.austingroupbugs.net/view.php?id=1937 ====================================================================== Reported By: dalias Assigned To: ====================================================================== Project: 1003.1(2024)/Issue8 Issue ID: 1937 Category: System Interfaces Type: Error Severity: Editorial Priority: normal Status: New Name: Rich Felker Organization: musl libc User Reference: Section: tsearch Page Number: unknown Line Number: unknown Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2025-07-21 16:02 UTC Last Modified: 2025-07-24 16:42 UTC ====================================================================== Summary: Undefined behavior in tsearch EXAMPLES text ======================================================================
---------------------------------------------------------------------- (0007231) geoffclare (manager) - 2025-07-24 16:42 https://www.austingroupbugs.net/view.php?id=1937#c7231 ---------------------------------------------------------------------- In today's teleconference we wondered whether it would be preferable to simplify the new code by omitting the initial cast where it's not actually needed (in comparisons and assignments), keeping it only for the count++ line which needs it. I.e.: Replace the 1st and 3rd instances of: <blockquote><pre>*(struct element **)</pre></blockquote> in EXAMPLES with: <blockquote><pre>*(void **)</pre></blockquote> Replace the instance of: <blockquote><pre>(*(struct element **)node)->count++;</pre></blockquote> with: <blockquote><pre>((struct element *)*(void **)node)->count++;</pre></blockquote> Replace the instance of: <blockquote><pre>const struct element *p = *(const struct element **) ptr;</pre></blockquote> with: <blockquote><pre>const struct element *p = *(void **) ptr;</pre></blockquote> Issue History Date Modified Username Field Change ====================================================================== 2025-07-21 16:02 dalias New Issue 2025-07-21 16:04 dalias Note Added: 0007225 2025-07-21 22:48 dalias Note Added: 0007226 2025-07-22 09:26 geoffclare Project 1003.1(2016/18)/Issue7+TC2 => 1003.1(2024)/Issue8 2025-07-22 10:01 geoffclare Note Added: 0007227 2025-07-24 16:42 geoffclare Note Added: 0007231 ======================================================================
