Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001470 [1003.1(2016/18)/Issue7+TC2] System Interfaces Objection Error 2021-05-07 13:22 2021-12-13 15:12
Reporter dennisw View Status public  
Assigned To
Priority normal Resolution Accepted  
Status Applied  
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 change
tdelete((void *)elementptr, &root, delete_root);
to
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
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker