[19622] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

On AIX with GCC 6.3.0, a "maybe-unitialized" variable generates an

daemon@ATHENA.MIT.EDU (REIX, Tony)
Wed Aug 23 09:28:24 2017

From: "REIX, Tony" <tony.reix@atos.net>
To: "krbdev@mit.edu" <krbdev@mit.edu>
Date: Wed, 23 Aug 2017 13:28:13 +0000
Message-ID: <B37989F2852398498001550C29155BE5178BBADC@FRCRPVV9EX3MSX.ww931.my-it-solutions.net>
Content-Language: fr-FR
Content-Type: multipart/mixed;
	boundary="_004_B37989F2852398498001550C29155BE5178BBADCFRCRPVV9EX3MSXw_"
MIME-Version: 1.0
Errors-To: krbdev-bounces@mit.edu

--_004_B37989F2852398498001550C29155BE5178BBADCFRCRPVV9EX3MSXw_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

On AIX with GCC 6.3.0, a "maybe-unitialized" variable generates an error.


File: src/lib/krb5/os/localaddr.c

gcc -maix64 -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -DH=
AVE_CONFIG_H -DLIBDIR=3D\"/opt/freeware/lib64\" -DBINDIR=3D\"/opt/freeware/=
bin\" -DSBINDIR=3D\"/opt/freeware/sbin\" -I../../../include -I../../../incl=
ude -I../../../util/profile -DKRB5_DEPRECATED=3D1 -DKRB5_PRIVATE  -DSYSV -D=
_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX7=
2 -D_ALL_SOURCE -DFUNCPROTO=3D15 -O -I/opt/freeware/include -D_THREAD_SAFE =
 -Wall -Wcast-align -Wshadow -Wmissing-prototypes -pedantic -Wno-format-zer=
o-length -Woverflow -Wstrict-overflow -Wmissing-format-attribute -Wmissing-=
prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-f=
unction -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -=
Wsign-compare -Werror=3Duninitialized -Werror=3Dpointer-arith -Werror=3Dint=
-conversion -Werror=3Dincompatible-pointer-types -Werror=3Ddiscarded-qualif=
iers -Werror=3Ddeclaration-after-statement -Werror-implicit-function-declar=
ation   -c localaddr.c



localaddr.c: In function 'krb5int_foreach_localaddr':
...
localaddr.c:1033:9: error: 'n' may be used uninitialized in this function [=
-Werror=3Dmaybe-uninitialized]
        for (i =3D 0; i + sizeof(struct ifreq) <=3D n; i+=3D ifreq_size(*if=
r) ) {
        ^~~

I've attached to this email a simple patch that fixes this issue.
     if (pass2fn) {
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
         for (i =3D 0; i + sizeof(struct ifreq) <=3D n; i+=3D ifreq_size(*i=
fr) ) {

Maybe that a better solution could be found.

Regards

Cordialement,

Tony Reix

Bull - ATOS
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 =C9chirolles - France
www.atos.net<http://www.atos.net/>

--_004_B37989F2852398498001550C29155BE5178BBADCFRCRPVV9EX3MSXw_
Content-Type: text/x-patch; name="krb5-1.15.1-maybe-uninitialized.patch"
Content-Description: krb5-1.15.1-maybe-uninitialized.patch
Content-Disposition: attachment;
	filename="krb5-1.15.1-maybe-uninitialized.patch"; size=381;
	creation-date="Wed, 23 Aug 2017 13:26:54 GMT";
	modification-date="Wed, 23 Aug 2017 13:26:54 GMT"
Content-Transfer-Encoding: base64

LS0tIC4vc3JjL2xpYi9rcmI1L29zL2xvY2FsYWRkci5jLk9SSUdJTgkyMDE3LTA4LTIzIDE1OjEz
OjE5ICswMjAwCisrKyAuL3NyYy9saWIva3JiNS9vcy9sb2NhbGFkZHIuYwkyMDE3LTA4LTIzIDE1
OjEyOjAyICswMjAwCkBAIC0xMDMwLDYgKzEwMzAsNyBAQAogICAgIC8qQD1tb2R1bmNvbkAqLwog
CiAgICAgaWYgKHBhc3MyZm4pIHsKKyNwcmFnbWEgR0NDIGRpYWdub3N0aWMgaWdub3JlZCAiLVdt
YXliZS11bmluaXRpYWxpemVkIgogICAgICAgICBmb3IgKGkgPSAwOyBpICsgc2l6ZW9mKHN0cnVj
dCBpZnJlcSkgPD0gbjsgaSs9IGlmcmVxX3NpemUoKmlmcikgKSB7CiAgICAgICAgICAgICBpZnIg
PSAoc3RydWN0IGlmcmVxICopKChjYWRkcl90KSBidWYraSk7CiAK

--_004_B37989F2852398498001550C29155BE5178BBADCFRCRPVV9EX3MSXw_
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

--_004_B37989F2852398498001550C29155BE5178BBADCFRCRPVV9EX3MSXw_--

home help back first fref pref prev next nref lref last post