Re: wget 1.10.2 (warnings)

2007-08-24 Thread Hrvoje Niksic
Esin Andrey <[EMAIL PROTECTED]> writes:

> 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)

Thank you for the report.  I don't understand the warning, but there
are problems with your patch.  You cannot cast opt.prefer_family to
int * because the value of opt.prefer_family is not a pointer.
Likewise, you cannot change assignment to *place to assignment to
place, since then you're only changing the value of a local variable,
rendering the code no-op.

I agree that warnings should be fixed, but one must be careful not to
break code in the process.


Re: wget 1.10.2 (warnings)

2007-08-24 Thread Micah Cowan
-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.0 +0400
> +++ wget-1.10.2/src/init.c2007-08-10 00:16:33.0 +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-


wget 1.10.2 (warnings)

2007-08-24 Thread Esin Andrey
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.0 +0400
+++ wget-1.10.2/src/init.c	2007-08-10 00:16:33.0 +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;


Re: I can download with a browser, but not with wget

2007-08-24 Thread Rafael Anschau
Thanks!

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> Rafael Anschau wrote:
> > bash-3.2$ wget http://www.intel.com/design/processor/manuals/253667.pdf
> > --20:01:01--  http://www.intel.com/design/processor/manuals/253667.pdf
> >=> `253667.pdf'
> > Resolving www.intel.com... 81.52.134.16, 81.52.134.24
> > Connecting to www.intel.com|81.52.134.16|:80... connected.
> > HTTP request sent, awaiting response... 403 Forbidden
> > 20:01:02 ERROR 403: Forbidden.
> 
> "--user-agent Mozilla" does the trick. Apparently Intel's website does
> not like wget. :)
> 
> - --
> 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
> 
> iD8DBQFGzhjU7M8hyUobTrERCPc8AJ9y82f2OpixUZALb2TU4slrOphfLQCgi40s
> rKU193KGDh778jM/kwekfME=
> =JIfb
> -END PGP SIGNATURE-


-- 
Rafael Anschau <[EMAIL PROTECTED]>