-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi Esin,
Unfortunately, the patch you've provided really doesn't seem appropriate, as it would try to convert an enumeration value into a pointer, which, while it might shut up a warning on your compiler, has a much higher chance of breaking than converting a pointer-to-enum to a pointer-to-int. If I read it correctly, Wget would almost certainly crash the moment someone specifies --prefer-family (did you test wget with --prefer-family before submitting the patch?). However, you'll be pleased to know that this issue (assuming an enum type is compatible with int, and likewise for their pointers) appears to have been fixed in the current trunk. - -Micah Esin Andrey wrote: > Hi! > I have downloaded wget-1.10.2 sources and try to compile it. > I have some warnings: > > /|init.c: In function ‘cmd_spec_prefer_family’ > init.c:1193: warning: доступ по указателю с приведением типа нарушает правила > перекрытия объектов в памяти > > |/I have wrote patch which correct this warnings (It is in attach) > > > > ------------------------------------------------------------------------ > > diff -urN wget-1.10.2.orig/src/init.c wget-1.10.2/src/init.c > --- wget-1.10.2.orig/src/init.c 2005-08-09 02:54:16.000000000 +0400 > +++ wget-1.10.2/src/init.c 2007-08-10 00:16:33.000000000 +0400 > @@ -1190,7 +1190,7 @@ > { "none", prefer_none }, > }; > int ok = decode_string (val, choices, countof (choices), > - (int *) &opt.prefer_family); > + (int *) opt.prefer_family); > if (!ok) > fprintf (stderr, _("%s: %s: Invalid value `%s'.\n"), exec_name, com, > val); > return ok; > @@ -1455,7 +1455,7 @@ > for (i = 0; i < itemcount; i++) > if (0 == strcasecmp (val, items[i].name)) > { > - *place = items[i].code; > + place = (int *)items[i].code; > return 1; > } > return 0; - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGz0Lf7M8hyUobTrERCImQAJ0WyfdxMXkR5QDCHN3gumzMd+GzpgCfU+ED 3FauLetjHa+eZxEeIiQzmkA= =Kqjy -----END PGP SIGNATURE-----