trying to understand: "warning: function declaration isn't a prototype"

Jay Vaughan jv@access-music.de
Thu Jul 6 09:21:00 GMT 2006


>Well, I explained why the warning is being emitted.
>

Yes, because I haven't suppressed it with a switch .. but what I want 
to know is what the warning means.

>Perhaps you could rephrase your question.  Or perhaps you could
>provide the exact error message and the line in the source code to
>which it refers.


../../common/Headers/msExtern.h:60: warning: function declaration 
isn't a prototype

------------------------------------
msTypes.h (#included by msDefs.h):
#define FAR
#define FarPtr(type)  type FAR *


------------------------------------
msDefs.h (#included by msExtern.h)

typedef FarPtr(void)                TApplContextPtr;


------------------------------------
msExtern.h:60:

TApplContextPtr CreateApplContext ();


------------------------------------
msLinux.c:

TApplContextPtr CreateApplContext()
{
     LinuxContextPtr ptr =
         (LinuxContextPtr) kmalloc(sizeof(LinuxContext), GFP_KERNEL);
   //.. etc ..
     return ptr;
}



The way I interpret this warning, its telling me that "FarPtr(void) 
CreatApplContext();" resolves to " * CreateApplContext();" .. clearly 
not a friendly prototype .. but which I suppose should probably be 
something more like (void) *CreateApplContext(); .. meaning I should 
fix the "#define FAR" to be "#define FAR void" instead ..

-- 

;

Jay Vaughan



More information about the Gcc-help mailing list