Consider the following code: #include <stdio.h>
double floor(double d) { return 5; } int main() { printf("Floor: %f", floor(3.4) ); } Note I'm not importing math.h so floor(3.4) should return 5, but the output from this function is: lyo...@soba-testing-) floor2 Floor: 3.000000 So it replaces it before checking for any overwritten* functions which return and take the same types and parameters. I assume this goes for ceil and trunc as well, but haven't tested them. It's not even overwritten because I'm not even importing math.h. The built in optimisation functions shouldn't have replaced floor(3.4) because I'm not importing math.h, but they did. This is compiled simply with 'gcc floor2.c floor2' -- Summary: Overwritten floor() function Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mindez at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42094