Mailing List Archive

apache V0.8.8 under Linux (fwd)
Not a bug, but one of our Linux gurus might want to check it or ignore it.


Forwarded message:
> Date: Wed, 16 Aug 1995 18:42:35 -0400
> From: root <root@linux.sjs.com>
> To: apache-bugs@apache.org
> Subject: apache V0.8.8 under Linux
>
> I just thought you might want to know that I compiled Apache V0.8.8 with Linux
> kernel V1.2.11 and Gcc V2.7.0 and got this one compiler warning:
>
> gcc -c -O2 -DLINUX mod_access.c
> mod_access.c: In function `create_access_dir_config':
> mod_access.c:96: warning: assignment makes integer from pointer without a cast
>
> The daemon seems to work ok.
>
> Steve Stuczynski
> Systems & Network Consultant
> e-mail: steve@sjs.com
> URL: http://www.sjs.com
>
>
Re: apache V0.8.8 under Linux (fwd) [ In reply to ]
|> Not a bug, but one of our Linux gurus might want to check it or
|> ignore it.


|> Forwarded message:

>> gcc -c -O2 -DLINUX mod_access.c mod_access.c: In function
>> `create_access_dir_config': mod_access.c:96: warning: assignment
>> makes integer from pointer without a cast

NULL is defined as ((void *) 0) in the GNU libc headers.
Line 96 of mod_access.c contains conf->order[i] = NULL,
where conf->order is a int.

The patch would be:

--- mod_access.c-dist Thu Aug 17 02:14:07 1995
+++ mod_access.c Thu Aug 17 02:14:28 1995
@@ -93,7 +93,7 @@
(access_dir_conf *)pcalloc(p, sizeof(access_dir_conf));
int i;

- for (i = 0; i < METHODS; ++i) conf->order[i] = NULL;
+ for (i = 0; i < METHODS; ++i) conf->order[i] = (int)NULL;
conf->allows = make_array (p, 1, sizeof (allowdeny));
conf->denys = make_array (p, 1, sizeof (allowdeny));


-JimC
--
James H. Cloos, Jr. Snail: POBox 18122 Austin, TX 78760-8122 Usenix,SAGE
cloos@io.com URL: http://www.jhcloos.com/~cloos/ LPF
Re: apache V0.8.8 under Linux (fwd) [ In reply to ]
>[James]
> The patch would be:
>
> --- mod_access.c-dist Thu Aug 17 02:14:07 1995
> +++ mod_access.c Thu Aug 17 02:14:28 1995
> @@ -93,7 +93,7 @@
> (access_dir_conf *)pcalloc(p, sizeof(access_dir_conf));
> int i;
>
> - for (i = 0; i < METHODS; ++i) conf->order[i] = NULL;
> + for (i = 0; i < METHODS; ++i) conf->order[i] = (int)NULL;
> conf->allows = make_array (p, 1, sizeof (allowdeny));
> conf->denys = make_array (p, 1, sizeof (allowdeny));
>

Uh, I'd rather see something cleaner and more explicit, like :

--- mod_access.c-dist Thu Aug 17 02:14:07 1995
+++ mod_access.c Thu Aug 17 02:14:28 1995
@@ -93,7 +93,7 @@
(access_dir_conf *)pcalloc(p, sizeof(access_dir_conf));
int i;

- for (i = 0; i < METHODS; ++i) conf->order[i] = NULL;
+ for (i = 0; i < METHODS; ++i) conf->order[i] = DENY_THEN_ALLOW;
conf->allows = make_array (p, 1, sizeof (allowdeny));
conf->denys = make_array (p, 1, sizeof (allowdeny));



--
Florent.Guillaume@ens.fr
Re: apache V0.8.8 under Linux (fwd) [ In reply to ]
Florent> Uh, I'd rather see something cleaner and more explicit, like :

Florent> --- mod_access.c-dist Thu Aug 17 02:14:07 1995
Florent> +++ mod_access.c Thu Aug 17 02:14:28 1995
Florent> @@ -93,7 +93,7 @@
Florent> (access_dir_conf *)pcalloc(p, sizeof(access_dir_conf));
Florent> int i;
Florent>
Florent> - for (i = 0; i < METHODS; ++i) conf->order[i] = NULL;
Florent> + for (i = 0; i < METHODS; ++i) conf->order[i] = DENY_THEN_ALLOW;
Florent> conf->allows = make_array (p, 1, sizeof (allowdeny));
Florent> conf->denys = make_array (p, 1, sizeof (allowdeny));

Good point. Next time I'll be sure to read through the whole file,
and not just a couple of lines either side of the warning....

-JimC
--
James H. Cloos, Jr. Snail: POBox 18122 Austin, TX 78760-8122 Usenix,SAGE
cloos@io.com URL: http://www.jhcloos.com/~cloos/ LPF