PDA

View Full Version : implicit declaration of function warning




MrFusion
Apr 8, 2011, 07:16 AM
I am using the accelerate framework, but get "implicit declaration of function" warnings when using the sgetrf() and sgetrs() functions.
The code works fine, but those two warnings annoy the hell out me.
I don't think I should define those functions anywhere since they are already defined in the clapack header.

Any idea how to get rid of these warnings? Thanks.


#import "MyObject.h"
#import <Accelerate/Accelerate.h>
#import <vecLib/vecLib.h> //does not get rid of warning
#import <vecLib/clapack.h> //does not get rid of warning
// #import <Accelerate/vecLib/clapack.h> //does not compile



jiminaus
Apr 8, 2011, 07:38 AM
Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

EDIT: Because we're calling Fortran code, so apparently the trailing underscore is to be expected. It also explains why all the arguments are passed by reference. However the examples in the Use the Accelerate Framework for Data Processing guide doesn't show the trailing underscores.

chown33
Apr 8, 2011, 10:12 AM
Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

Maybe there's a sgetrf() macro somewhere that's defined in terms of sgetrf_().

MrFusion
Apr 8, 2011, 10:20 AM
Hmmm.... in vecLib/clapack.h they're declared with a trailing underscore. If I replace sgetrf with sgetrf_ it still compiles and runs and the implicit declaration warning goes away. Strange that they're declared this way?

EDIT: Because we're calling Fortran code, so apparently the trailing underscore is to be expected. It also explains why all the arguments are passed by reference. However the examples in the Use the Accelerate Framework for Data Processing guide doesn't show the trailing underscores.

That does the trick. Thanks. I also doubt the underscore was present in the examples I found a while back and I obviously overlooked them in the header file.