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: Jeff Bailey
Subject: Re: [bug-inetutils] Cleaning up warnings
Date: Mon, 5 May 2008 21:20:21 -0700

On Mon, May 5, 2008 at 7:58 PM, Debarshi Ray <address@hidden> wrote:
> Over the last few days, I have been trying to reduce the massive
>  amount of warnings that are generated by CFLAGS="-Wall". There is
>  still much to do, but I thought I will just let you review what I have
>  got so far:
>
>  diff -urNp inetutils/libls/ls.c inetutils-build/libls/ls.c
>  --- inetutils/libls/ls.c        2007-12-10 21:17:19.000000000 +0530
>  +++ inetutils-build/libls/ls.c  2008-04-22 08:48:34.000000000 +0530
>  @@ -107,7 +107,7 @@ ls_main (argc, argv)
>   {
>    static char dot[] = ".", *dotav[] = { dot, NULL };
>    struct winsize win;
>  -  int ch, fts_options, notused;
>  +  int ch, fts_options;
>    int kflag = 0;
>    char *p;
>
>  @@ -265,6 +265,7 @@ ls_main (argc, argv)
>    if (f_longform || f_size)
>      {
>   #ifdef ORIGINAL_SOURCE
>  +      int notused;
>        if (!kflag)
>         getbsize (&notused, &blocksize);
>   #else

If we don't use this, can we just change getbsize to not require it?
Maybe hand in a NULL if we don't care.

>  diff -urNp inetutils/telnetd/slc.c inetutils-build/telnetd/slc.c
>  --- inetutils/telnetd/slc.c     2007-12-10 21:17:18.000000000 +0530
>  +++ inetutils-build/telnetd/slc.c       2008-04-28 00:37:12.000000000 +0530
>  @@ -284,7 +284,7 @@ process_slc (register unsigned char func
>   * Compare client's request with what we are capable of supporting.
>   */
>   void
>  -change_slc (register char func, register char flag, register cc_t val)
>  +change_slc (register int func, register char flag, register cc_t val)
>   {
>    register int hislevel, mylevel;
>

I'd be inclined to rip out all the 'register' declarations.  gcc can
do a better job than a mortal can in most cases of getting this right
cross-platform.

>  diff -urNp inetutils/telnetd/telnetd.c inetutils-build/telnetd/telnetd.c
>  --- inetutils/telnetd/telnetd.c 2007-12-10 21:17:18.000000000 +0530
>  +++ inetutils-build/telnetd/telnetd.c   2008-05-06 08:02:59.000000000 +0530
>  @@ -216,10 +216,12 @@ static struct
>    int modnum;
>   } debug_mode[debug_max_mode] =
>   {
>  -"options", debug_options,
>  -    "report", debug_report,
>  -    "netdata", debug_net_data,
>  -    "ptydata", debug_pty_data, "auth", debug_auth,};
>  +  {"options", debug_options},
>  +  {"report", debug_report},
>  +  {"netdata", debug_net_data},
>  +  {"ptydata", debug_pty_data},
>  +  {"auth", debug_auth}
>  +};

Memory is failing me here - is this the C99 way of handling a
structure?  Are we assuming a C99 compiler?  (Or better, are we
assuming gcc and assuming gnu99?)

Awesome to see this stuff getting done!


-- 
Jeff Bailey - http://www.raspberryginger.com/jbailey/
 - "Remember, homosexuality is a choice, like cancer" - midwestteensexshow.com




reply via email to

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