Prototype checking of function calls

Jim Cant cant at mrmarx.msc.com
Sat May 4 02:10:47 AEST 1991


Some questions about compiling under AIX 3.0 on the RS 6000:

I would like the compiler to warn me whenever a function call does not match
it's prototype and I can't figure out how to do it.  I have tried the -extchk
option, -langlvl=ansi, and the xlc compiler.  Can I get this kind of
information?
The compiler does complain if a function definition does not match it's
declaration in the prototype but I still need warning for the invocations;
it would save LOTS of debugging.  (I am porting a lot of code for which the
prototypes have changed.)

Below is sample code of the sort I need warnings from:

By the way, what does -extchk option do?  I get the following message from
the following code compiled with "cc -extchk tmp.c":
    0706-244 ERROR: No entry point or export symbols were found
	     following garbage collection.

        /* Function prototypes */
        int funcShort(long l);
        int funcCPP(char **  ppc);

    int funcShort(long l)
    {
    return (1);
    }

    int funcCPP(char **  cpp)
    {
    return (1);
    }

    main()
    {char  * pChar; 
     char ** ppChar;
     short Short;
     long  Long;
            funcShort(Short);
            funcShort(Long);           /*compiler should warn*/
            funcShort((short)Long);    /*compiler should accept*/
            funcCPP(ppChar);
            funcCPP(ppChar);           /*compiler should warn*/
            funcCPP( (char **)pChar);  /*compiler should accept*/
    }

Any help or advice will be greatly appreciated.
Thanks a priori.

Jim Cant, cant at mrmarx.msc.com   I don't care what the company thinks
Mainstream Software Corp.	about what I think or say nearly as much
411 Waverly Oaks Road		I care about how my boy responds to same.
Waltham MA 02154, 617-894-3399



More information about the Comp.unix.aix mailing list