View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001470 | 1003.1(2016/18)/Issue7+TC2 | System Interfaces | public | 2021-05-07 13:22 | 2024-06-11 09:08 |
Reporter | dennisw | Assigned To | |||
Priority | normal | Severity | Objection | Type | Error |
Status | Closed | Resolution | Accepted | ||
Name | Dennis Wölfing | ||||
Organization | |||||
User Reference | |||||
Section | tdelete | ||||
Page Number | 2138-2139 | ||||
Line Number | 68532-68556 | ||||
Interp Status | --- | ||||
Final Accepted Text | |||||
Summary | 0001470: tdelete example is incorrect | ||||
Description | The example says that a comparison function that always returns 0 can be used with tdelete to delete the root node of a binary search tree. However the standard does not actually guarantee this. It only says that some node will be deleted in this case but nothing says that this will be the root node. Perhaps a balancing search tree algorithm might need to look at multiple nodes to ensure balancing and might then end up with deleting a non-root node since all nodes are considered to be equal. | ||||
Desired Action | On page 2138 line 68532 changetotdelete((void *)elementptr, &root, delete_root); tdelete((void *)elementptr, &root, node_compare); On pages 2138-2139 lines 68547-68556 delete /* * This comparison routine can be used with tdelete() * when explicitly deleting a root node, as no comparison * is necessary. */ int delete_root(const void *node1, const void *node2) { return 0; } | ||||
Tags | tc3-2008 |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-05-07 13:22 | dennisw | New Issue | |
2021-05-07 13:22 | dennisw | Name | => Dennis Wölfing |
2021-05-07 13:22 | dennisw | Section | => tdelete |
2021-05-07 13:22 | dennisw | Page Number | => 2138-2139 |
2021-05-07 13:22 | dennisw | Line Number | => 68532-68556 |
2021-11-18 17:00 | Don Cragun | Interp Status | => --- |
2021-11-18 17:00 | Don Cragun | Status | New => Resolved |
2021-11-18 17:00 | Don Cragun | Resolution | Open => Accepted |
2021-11-18 17:00 | Don Cragun | Tag Attached: tc3-2008 | |
2021-12-13 15:12 | geoffclare | Status | Resolved => Applied |
2024-06-11 09:08 | agadmin | Status | Applied => Closed |