This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] proc-api.c: uninitialized var warning fix.
- To: Elena Zannoni <ezannoni at cygnus dot com>
- Subject: Re: [RFA] proc-api.c: uninitialized var warning fix.
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 10 May 2001 10:57:16 -0700
- CC: gdb-patches at sources dot redhat dot com
- Organization: Red Hat
- References: <15098.741.725593.771628@kwikemart.cygnus.com>
Elena Zannoni wrote:
>
> I am getting the following warning when compiling gdb on solaris:
>
> /source3/src/gdb/proc-api.c: In function `ioctl_with_trace':
> /source3/src/gdb/proc-api.c:223: warning: `i' might be used uninitialized in this function
>
> OK to apply this patch?
Sure, go ahead.
Michael
> 2001-05-09 Elena Zannoni <ezannoni@redhat.com>
>
> * proc-api.c (ioctl_with_trace): Fix uninitialized variable.
>
> Index: proc-api.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/proc-api.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 proc-api.c
> --- proc-api.c 2001/03/27 02:01:11 1.9
> +++ proc-api.c 2001/05/10 02:34:55
> @@ -219,7 +220,9 @@ static struct trans ioctl_table[] = {
> int
> ioctl_with_trace (int fd, long opcode, void *ptr, char *file, int line)
> {
> - int i, ret, arg1;
> + int i = 0;
> + int ret;
> + int arg1;
>
> prepare_to_trace ();
>