AnsweredAssumed Answered

Warning : C1801: Implicit parameter-declaration for 'unknown'

Question asked by John Dammeyer on Jan 27, 2009
Latest reply on Jan 27, 2009 by CompilerGuru
After a bit of searching I find I can turn this warning into either an error or information or even turn it off.  Don't really want to do that because it's useful.  But I really don' t like spurious warnings showing up.  Too many and I have a tendancy to ignore the real once because I'm busy ignoring the ignorable ones.
 
I'm having trouble making the stdio.h library work without the C1801 error showing up.
Code:
void PutString(FILE *f, char * ptr ) {  char ch;  int res;   ch = *ptr; while (ch) {     ch = *ptr;     if (ch != (char)0)                 // (void)putc(ch,f);         res = putc(ch,stdout);   <=== Here's the error.  ptr++; }}

 
As shown in the code fragment I've taken it to the simplest form with stdout directly in the function call and not voiding the result. In the FILE declaration the write_channel declaration obviously doesn't have an argument. and the stdout definition supplies the address of the FILE structure
 
Code:
typedef struct chnl {...int   (*write_channel)();  /* routine for port writes         */} FILE;FILE channels[1];#define  stdout   (&channels[0])
#define putc(c,s)   (*((s)->write_channel))(c)

 
As I see it inside the FILE structure there should be the declarations that avoid this error.  But for some reason I can't get that to work either.  What I tried is a structure called MFILE and the appropriate variables declared with this etc...
 
Is there a solution or do I have to live with this?
 
Thanks
John

Outcomes