Gevik Babakhani wrote:
> I noticed the following compile warnings. Perhaps someone is interested
> to know about them.
>
> /usr/bin/flex -o'pgc.c' pgc.l
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g
> -Wno-error -I./../include -I. -I../../../../src/include -D_GNU_SOURCE
> -DMAJOR_VERSION=4 -DMINOR_VERSION=2 -DPATCHLEVEL=1 -c -o preproc.o
> preproc.c -MMD
> In file included from preproc.y:6606:
> pgc.c: In function ?yylex?:
> pgc.c:1549: warning: label ?find_rule? defined but not used
This is a standard warning generated by bison and we can't get rid of
it.
> _GNU_SOURCE -c -o mac.o mac.c -MMD
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g
> -I../../../../src/include -D_GNU_SOURCE -c -o inet_net_ntop.o
> inet_net_ntop.c -MMD
> inet_net_ntop.c: In function ?inet_cidr_ntop_ipv6?:
> inet_net_ntop.c:292: warning: value computed is not used
I have fixed this by adding a (void) cast, patch attached.
--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Index: src/backend/utils/adt/inet_net_ntop.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/adt/inet_net_ntop.c,v
retrieving revision 1.21
diff -c -c -r1.21 inet_net_ntop.c
*** src/backend/utils/adt/inet_net_ntop.c 15 Oct 2005 02:49:28 -0000 1.21
--- src/backend/utils/adt/inet_net_ntop.c 24 Apr 2006 19:49:04 -0000
***************
*** 289,295 ****
}
}
/* Format CIDR /width. */
! SPRINTF((cp, "/%u", bits));
if (strlen(outbuf) + 1 > size)
goto emsgsize;
strcpy(dst, outbuf);
--- 289,295 ----
}
}
/* Format CIDR /width. */
! (void) SPRINTF((cp, "/%u", bits));
if (strlen(outbuf) + 1 > size)
goto emsgsize;
strcpy(dst, outbuf);