Name clash

A user routine has the same name as an intrinsic function.

Using subroutine names that duplicate the names of intrinsic functions is discouraged. Users who read such code are likely to assume that calls to this function are calling the intrinsic function, which leads to misunderstandings and possible errors. It also renders the intrinsic function invisible.

ID

Observation

Description

1

Definition

This shows where the user function was defined

Example

          
#include <stdio.h>

// redefines built-in function with different types
int sin(int i) {
    return i;
}

int main(int argc, char **argv)
{
    printf("%d\n", sin(argc));
    return 0;
}
        
Here is the same example in FORTRAN:
          
integer function sin(i)
integer :: i
sin = i
end
external :: sin
integer :: sin, j
read *, j
print *, sin(j)
    end
        

Copyright © 2010, Intel Corporation. All rights reserved.