Diagnostic 15140: The function 'xxxx' declared as vector function in one module does not have prototype in another module.

Cause:

This diagnostic message is emitted because the function bar1() is not having access to the prototype of foo() which is declared in another compilation unit. Below is an example for this scenario.


Examples:

$cat example51.c


	__declspec(vector) int foo(int);

	int bar(int x){

	  return foo(x);

	}

	

$cat example52.c


	int bar1(int x){

	  return foo(x);

	}

	


$ icc example51.c example52.c -ipo
warning #15140: The function 'foo' declared as vector function in one module does not have prototype in another module.

Recommendation:

Do the following changes to make it work fine.

$ cat header.h


	__declspec(vector) int foo(int);

	

$ cat example51.c


	#include"header.h"

	int bar(int x){

	  return foo(x);

	}

	

$ cat example52.c


	#include"header.h"

	int bar1(int x){

	  return foo(x);

	}

	

This makes sure that the declaration of the SIMD-enabled function is visible for both the compilation units.

For more complete information about compiler optimizations, see our Optimization Notice.