Call to function with no prototype 
Author Message
 Call to function with no prototype

I recently turned the flag on  for TC 2.0 to check "Call to funciton
with no prototyppe" warning, and I find I can't eliminate the following:

case 1:
...
void (*show_char)();  /* define a variable of a function pointer */
...
   show_char();       /* WARNING: no prototype */

case 2:
...
void hardcopy(void onerow())  /* pass a function */
{
  ...
  onerow();           /* WARNGIN: no prototype */

How can I get rid of the WARNINGs in the above two cases?

--
//Yijun Ding, Pittsburgh //Go your way, be happy.



Sun, 09 Apr 1995 22:50:14 GMT  
 Call to function with no prototype

Quote:


>Subject: Call to function with no prototype
>Date: 21 Oct 92 14:50:14 GMT
>I recently turned the flag on  for TC 2.0 to check "Call to funciton
>with no prototyppe" warning, and I find I can't eliminate the following:
>case 1:
>...

You need either

void show_char(void);

or

    *show_char();

Quote:
>void (*show_char)();  /* define a variable of a function pointer */
>...
>   show_char();       /* WARNING: no prototype */

Here you must prototype onerow as well as hardcopy:

void onerow(void)
void hardcopy(void onerow(void))

Quote:
>case 2:
>...
>void hardcopy(void onerow())  /* pass a function */
>{
>  ...
>  onerow();           /* WARNGIN: no prototype */
>How can I get rid of the WARNINGs in the above two cases?
>--
>//Yijun Ding, Pittsburgh //Go your way, be happy.

 ----------------------------------------------------------------------------
    "This must be Thursday.  I never could get the hang of Thursdays"
                                                       - Douglas Adams
  - Patrick Taylor                                       (Arthur Dent)
    Ericsson Network Systems




Mon, 10 Apr 1995 00:43:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. call to function prototypes

2. how to prototype a function call

3. Warning Call to Function w/no Prototype in

4. Function prototype that RUNDLL32 calls?

5. Function returning a function-pointer - how to prototype ?

6. prototype (?) of function passed to function

7. Function prototypes for pointers to functions.

8. HELP: function prototype with pointer to function as parameter

9. Condition breakpoints and function calls and function calls in Immediate window

10. How can i make a C call prototype to a DLL

11. Call a function in a function with name of a function as parameter

12. help:prototype inconsistent with implementation of function

 

 
Powered by phpBB® Forum Software