non-prototype declaration in scope

Hello, I’m new at all this. I’m trying to build some libraries for an atmospheric model, and when I execute the make command, I get this message:



PGC-W-0136-Function MPI_Wtime has non-prototype declaration in scope (./mpi.h: 77)

PGC/x86 Linux 8.0-3: compilation completed with warnings

pgcc -c wtime.c

This happens with only one of the libraries, but I don´t know what it means or how bad is this warning.
I’ll thank any kind of help or comments.
I forgot: I use Fedora core 9 in a pentium dual core

Hi Clima,

This warning occurs then a function is used without having a prototype. In these cases, it’s assumed to be declared ‘int’. For example:

% cat hello.c
#include <stdio.h>
int main () {
   int a = 2;
   a = foo(a);
   printf("Hello %d\n", a);
   return 0;
}

int foo (int a) {
   return a*2;
}

% pgcc -o hello.exe -V8.0-4 hello.c
PGC-W-0136-Function foo has non-prototype declaration in scope (hello.c: 10)
PGC/x86-64 Linux 8.0-4: compilation completed with warnings

In the this case, the warning can be ignored since “foo” does return an int. However, if “foo” were in a library and returned a float, then there could be problems.

Which version of MPI are you using? Is the “mpi.h” file your own or is it from your MPI library?

  • Mat

Hello Mat, the mpi.h file is inside the atmospheric model program and the MPI version is the 8.0 (I’ve downloaded the last version available).
The line in the mpi.h file for the warning is this:

#define MPI_DOUBLE 1

double MPI_Wtime();
.
.
/* Prototypes: */
double MPI_Wtime( void ); (line 77)

as you can see, this variable is already declared as double.
should I think the problem could be in the MPI version?
thanks for answering!
Laura

Hi Laura,

I think you are correct that there is some type of version mismatch since the “mpi.h” file is usually different for each MPI implementation. Try using the header files accompanying the PGI MPICH build (by default located in /opt/pgi/linux86-64/8.0/mpi/mpich/include). Also, be sure to use the “mpicc” script found in /opt/pgi/linux86-64/8.0/mpi/mpich/bin.

  • Mat