Bug in current network.c - Mailing list pgsql-hackers

From Andreas Zeugswetter
Subject Bug in current network.c
Date
Msg-id 01BE032C.E8B34660@zeugswettera.user.lan.at
Whole thread Raw
Responses Re: [HACKERS] Bug in current network.c
List pgsql-hackers
The network.c from current CVS has:

xlc -I../../../include -I../../../backend   -I/usr/local/include 
-qchars=signed -qmaxmem=8192 -qhalt=w -qsrcmsg -qcheck=divzero -qlonglong -g -qfullpath -I../..   -c network.c -o
network.o    400 |                 if (inet_cidr_ntop(2, &addr, (((inet_struct 
 
*)(((struct varlena *)(ip))->vl_dat))->bits), tmp, sizeof(tmp)) < 0)
............................................................. 
 
...............................................................a...
a - 1506-068 (S) Operation between types "char*" and "int" is not allowed.
gmake[3]: *** [network.o] Error 1

It should probably read as follows: (but please check)
(I sure hope it comes without those stupid wraps my mailer always 
generates)

*** network.c.ori    Thu Oct 29 09:51:42 1998
--- network.c    Thu Oct 29 10:35:59 1998
***************
*** 397,403 ****         /* It's an IP V4 address: */         int    addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff <<
(32- 
 
ip_bits(ip))));

!         if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) < 0)         {             elog(ERROR,
"unableto print network (%s)", strerror(errno));             return (NULL);
 
--- 397,403 ----         /* It's an IP V4 address: */         int    addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff <<
(32- 
 
ip_bits(ip))));

!         if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) == 
NULL)         {             elog(ERROR, "unable to print network (%s)", strerror(errno));             return (NULL);


Attached is also a correct inet.out


begin 600 inet.out
M455%4EDZ($123U @5$%"3$4@24Y%5%]40DP["D524D]2.B @4F5L871I;VX@
M:6YE=%]T8FP@1&]E<R!.;W0@17AI<W0A"E%515)9.B!#4D5!5$4@5$%"3$4@
M24Y%5%]40DP@*&,@8VED<BP@:2!I;F5T*3L*455%4EDZ($E.4T525"!)3E1/
M($E.151?5$),("AC+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N,2XR+C,O,S(@?#$P+C$N,BXS(" @(" @
M(" *(" @("!\,3 N,2XR+S(T(" @?#$P+C$N,BXS+S(T(" @(" *(" @("!\
M,3 N,2\Q-B @(" @?#$P+C$N,BXS+S$V(" @(" *(" @("!\,3 O." @(" @
M(" @?#$P+C$N,BXS+S@@(" @(" **#@@<F]W<RD*"E%515)9.B!314Q%0U0@
M)R<@87,@96EG:'0L(&D@87,@:6YE="P@:&]S="AI*2!&4D]-($E.151?5$),
M.PIE:6=H='QI;F5T(" @(" @(" @(" @?" @(" @(" @(&AO<W0*+2TM+2TK
M+2TM+2TM+2TM+2TM+2TM+2LM+2TM+2TM+2TM+2TM"B @(" @?#$Y,BXQ-C@N
M,2XR,C8O,C1\,3DR+C$V."XQ+C(R-@H@(" @('PQ.3(N,38X+C$N,C(V(" @
M?#$Y,BXQ-C@N,2XR,C8*(" @("!\,3 N,2XR+C,O." @(" @('P@(" @(#$P
M+C$N,BXS"B @(" @?#$P+C$N,BXS+S@@(" @("!\(" @(" Q,"XQ+C(N,PH@
M(" @('PQ,"XQ+C(N,R @(" @(" @?" @(" @,3 N,2XR+C,*(" @("!\,3 N
M,2XR+C,O,C0@(" @('P@(" @(#$P+C$N,BXS"B @(" @?#$P+C$N,BXS+S$V
M(" @("!\(" @(" Q,"XQ+C(N,PH@(" @('PQ,"XQ+C(N,R\X(" @(" @?" @
M(" @,3 N,2XR+C,**#@@<F]W<RD*"E%515)9.B!314Q%0U0@)R<@87,@96EG
M:'0L(&,@87,@8VED<BP@8G)O861C87-T*&,I+ H@(&D@87,@:6YE="P@8G)O
M861C87-T*&DI($923TT@24Y%5%]40DP["F5I9VAT?&-I9'(@(" @(" @('P@
M(" @(&)R;V%D8V%S='QI;F5T(" @(" @(" @(" @?" @(" @8G)O861C87-T
M"BTM+2TM*RTM+2TM+2TM+2TM+2LM+2TM+2TM+2TM+2TM+2LM+2TM+2TM+2TM
M+2TM+2TM*RTM+2TM+2TM+2TM+2TM"B @(" @?#$Y,BX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@(" @(" R-'PQ.3(N,38X+C$N
M,C(V+S(T?" @(" @(" @(" @,C0*(" @("!\,3DR+C$V."XQ+S(T?" @(" @
M(" @(" @,C1\,3DR+C$V."XQ+C(R-B @('P@(" @(" @(" @(#,R"B @(" @
M?#$P+S@@(" @(" @('P@(" @(" @(" @(" X?#$P+C$N,BXS+S@@(" @("!\
M(" @(" @(" @(" @. H@(" @('PQ,"XP+C N,"\S,B!\(" @(" @(" @(" S
M,GPQ,"XQ+C(N,R\X(" @(" @?" @(" @(" @(" @(#@*(" @("!\,3 N,2XR
M+C,O,S(@?" @(" @(" @(" @,S)\,3 N,2XR+C,@(" @(" @('P@(" @(" @
M(" @(#,R"B @(" @?#$P+C$N,B\R-" @('P@(" @(" @(" @(#(T?#$P+C$N
M,BXS+S(T(" @("!\(" @(" @(" @(" R- H@(" @('PQ,"XQ+S$V(" @("!\
M(" @(" @(" @(" Q-GPQ,"XQ+C(N,R\Q-B @(" @?" @(" @(" @(" @,38*
M(" @("!\,3 O." @(" @(" @?" @(" @(" @(" @(#A\,3 N,2XR+C,O." @
M(" @('P@(" @(" @(" @(" X"B@X(')O=W,I"@I1545263H@4T5,14-4("<G
M(&%S('1W;RP@8R!A<R!C:61R+"!M87-K;&5N*&,I(&%S(")M87-K;&5N*&-I
M9'(I(BP*("!I(&%S(&EN970L(&UA<VML96XH:2D@87,@(FUA<VML96XH:6YE
M="DB($923TT@24Y%5%]40DP*("!72$5212!M87-K;&5N*&,I(#P](#@["G1W
M;WQC:61R?&UA<VML96XH8VED<BE\:6YE=" @(" @('QM87-K;&5N*&EN970I
M"BTM+2LM+2TM*RTM+2TM+2TM+2TM+2TK+2TM+2TM+2TM+2LM+2TM+2TM+2TM
M+2TM"B @('PQ,"\X?" @(" @(" @(" @(#A\,3 N,2XR+C,O.'P@(" @(" @
M(" @(" X"B @('PQ,"\X?" @(" @(" @(" @(#A\,3 N,2XR+C,O.'P@(" @
M(" @(" @(" X"B@R(')O=W,I"@I1545263H@4T5,14-4("<G(&%S('-I>"P@
M8R!A<R!C:61R+"!I(&%S(&EN970@1E)/32!)3D547U1"3 H@(%=(15)%(&,@
M/2!I.PIS:7A\8VED<B @(" @(" @?&EN970@(" @(" @(" @(" *+2TM*RTM
M+2TM+2TM+2TM+2LM+2TM+2TM+2TM+2TM+2TM"B @('PQ.3(N,38X+C$O,C1\
M,3DR+C$V."XQ+C(R-B\R- H@("!\,3 O." @(" @(" @?#$P+C$N,BXS+S@@
M(" @(" *(" @?#$P+C$N,BXS+S,R('PQ,"XQ+C(N,R @(" @(" @"B @('PQ
M,"XQ+C(O,C0@("!\,3 N,2XR+C,O,C0@(" @( H@("!\,3 N,2\Q-B @(" @
M?#$P+C$N,BXS+S$V(" @(" *(" @?#$P+S@@(" @(" @('PQ,"XQ+C(N,R\X
1(" @(" @"B@V(')O=W,I"@H*
`
end



pgsql-hackers by date:

Previous
From: Andreas Zeugswetter
Date:
Subject: AW: [HACKERS] Last call? (Siemens RM Port)
Next
From: Andreas Zeugswetter
Date:
Subject: Re: [HACKERS] configure and cpp detection