bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Cleaning up warnings


From: Sergey Poznyakoff
Subject: Re: [bug-inetutils] Cleaning up warnings
Date: Tue, 06 May 2008 10:12:53 +0300

Debarshi Ray <address@hidden> ha escrit:

> Over the last few days, I have been trying to reduce the massive
> amount of warnings that are generated by CFLAGS="-Wall".

Great.

> There is still much to do, but I thought I will just let you review
> what I have got so far:

Looks OK, except for the following errors:

> diff -urNp inetutils/libls/stat_flags.c inetutils-build/libls/stat_flags.c
> --- inetutils/libls/stat_flags.c      2007-12-10 21:17:19.000000000 +0530
> +++ inetutils-build/libls/stat_flags.c        2008-04-22 08:46:11.000000000 
> +0530
> @@ -103,8 +103,7 @@ string_to_flags (stringp, setp, clrp)
>       char **stringp;
>       u_int *setp, *clrp;
>  {
> -  int clear;
> -  char *string, *p;
> +  char *string;
> 
>    if (setp)
>      *setp = 0;
> @@ -112,6 +111,9 @@ string_to_flags (stringp, setp, clrp)
>      *clrp = 0;
>    string = *stringp;
>  #ifdef ORIGINAL_SOURCE
> +  int clear;
> +  char *p;
> +

Nope, placing declarations after statements assumes C99! Many compilers
(including gcc 3.x) will give error at this place. 

> diff -urNp inetutils/telnetd/utility.c inetutils-build/telnetd/utility.c
> --- inetutils/telnetd/utility.c       2007-12-10 21:17:18.000000000 +0530
> +++ inetutils-build/telnetd/utility.c 2008-05-06 07:54:43.000000000 +0530
[..]
> @@ -1346,6 +1358,8 @@ printsub (int direction, unsigned char *
> 
>  #if defined(AUTHENTICATION)
>      case TELOPT_AUTHENTICATION:
> +      char buf[512];
> +
>        debug_output_data ("AUTHENTICATION");

The same here.
 
> @@ -1419,7 +1433,10 @@ printsub (int direction, unsigned char *
> 
>  #ifdef       ENCRYPTION
>      case TELOPT_ENCRYPT:
> +      char buf[512];
> +
>        debug_output_data ("ENCRYPT");

And here.

Apart from that, the patch is OK.

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]