Chris Morley wrote:
> Hi guys:
> 
> I am trying to fix compiler warnings on classicladder v7.124.
> In the file.c source there is a warning:  ISO C90 forbids mixed declarations 
> and code. Of course if I just change the order of  the code to stop the error 
> it changes the info that the function fgets is passed. Please see the code 
> below, I  put '->' in front of the lines I'm talking about. What is the right 
> way to fix this? ( I'm kinda betting the whole function would need to be 
> rewritten).
> 
> Thanks Chris Morley
> 
> char *cl_fgets(char *s, int size, FILE *stream)
> {
> ->      s[0] = '\0';
           ^ Declares a variable only.

> ->      char * res = fgets( s, size, stream );
           ^ declares a variable AND runs some code to initialize it.

Traditional C wants all declarations first, then all code.

Regards,

John Kasunich


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to