You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1998/01/10 05:54:55 UTC
[PATCH] mod_status warnings
Index: mod_status.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_status.c,v
retrieving revision 1.70
diff -u -r1.70 mod_status.c
--- mod_status.c 1998/01/07 16:46:57 1.70
+++ mod_status.c 1998/01/10 04:44:30
@@ -364,12 +364,14 @@
(float) count / (float) up_time);
if (up_time > 0) {
- format_byte_out(r, KBYTE * (float) kbcount / (float) up_time);
+ format_byte_out(r, (unsigned long)
+ (KBYTE * (float) kbcount / (float) up_time));
rputs("/second - ", r);
}
if (count > 0) {
- format_byte_out(r, KBYTE * (float) kbcount / (float) count);
+ format_byte_out(r, (unsigned long)
+ (KBYTE * (float) kbcount / (float) count));
rputs("/request", r);
}
Re: [PATCH] mod_status warnings
Posted by Marc Slemko <ma...@worldgate.com>.
On Sat, 10 Jan 1998, Ben Laurie wrote:
> Marc Slemko wrote:
> >
> > On Sat, 10 Jan 1998, Dean Gaudet wrote:
> >
> > > I would be 100% happier if that warning was disabled and these "problems"
> > > ignored. These changes Marc is proposing aren't increasing the quality
> >
> > I would hope that would be easy. There are places to pick what erros you
> > want, but I can't make it work right... and don't know if it gets into the
> > generated makefile...
>
> Erk. Surely we don't want to switch them off globally? Use pragmas to
Why not? They are dumb warnings anyway, so...
> switch them off locally.
I don't want to clutter up a whole bunch of places just for dumb
compilers. Can't you disable them at the per file level? It looked like
you could, but that could be a trick... don't feel like rebooting now to
look.
Re: [PATCH] mod_status warnings
Posted by Ben Laurie <be...@algroup.co.uk>.
Marc Slemko wrote:
>
> On Sat, 10 Jan 1998, Dean Gaudet wrote:
>
> > I would be 100% happier if that warning was disabled and these "problems"
> > ignored. These changes Marc is proposing aren't increasing the quality
>
> I would hope that would be easy. There are places to pick what erros you
> want, but I can't make it work right... and don't know if it gets into the
> generated makefile...
Erk. Surely we don't want to switch them off globally? Use pragmas to
switch them off locally.
Cheers,
Ben.
--
Ben Laurie |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant |Fax: +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd, |http://www.algroup.co.uk/Apache-SSL
London, England. |"Apache: TDG" http://www.ora.com/catalog/apache
Re: [PATCH] mod_status warnings
Posted by Marc Slemko <ma...@worldgate.com>.
On Sat, 10 Jan 1998, Dean Gaudet wrote:
> I would be 100% happier if that warning was disabled and these "problems"
> ignored. These changes Marc is proposing aren't increasing the quality
I would hope that would be easy. There are places to pick what erros you
want, but I can't make it work right... and don't know if it gets into the
generated makefile...
Ok, lets try to do that.
> of the code, they're restating exactly what the C type rules require.
> But once the cast is there, it doesn't matter what the quantity on
> the RHS ever becomes, because the compiler is being told to ignore any
> potentially wrong things about it.
I agree.
Re: [PATCH] mod_status warnings
Posted by Dean Gaudet <dg...@arctic.org>.
I want to mention that I don't like the Microsoft C compiler warnings that
are causing these casts to be added left and right. I certainly won't
sanction casts that "fix" the mod_include and regex warnings. Those are
warnings caused by C constructs like:
char *dest;
char *d;
size_t len;
d = dest;
... do something with d, d >= dest is an invariant ...
if (d - dest >= len) break;
That last line is causing warnings on the msc compiler. I say it's a
load of crap. Adding a cast to that line (or lines like it) can quite
easily cause problems in the future. Now if only I could find the
beautiful example of a cast gone awry I had a few months ago, I think
I posted it here. I'll dig.
I would be 100% happier if that warning was disabled and these "problems"
ignored. These changes Marc is proposing aren't increasing the quality
of the code, they're restating exactly what the C type rules require.
But once the cast is there, it doesn't matter what the quantity on
the RHS ever becomes, because the compiler is being told to ignore any
potentially wrong things about it.
Dean
On Fri, 9 Jan 1998, Marc Slemko wrote:
> Index: mod_status.c
> ===================================================================
> RCS file: /export/home/cvs/apachen/src/modules/standard/mod_status.c,v
> retrieving revision 1.70
> diff -u -r1.70 mod_status.c
> --- mod_status.c 1998/01/07 16:46:57 1.70
> +++ mod_status.c 1998/01/10 04:44:30
> @@ -364,12 +364,14 @@
> (float) count / (float) up_time);
>
> if (up_time > 0) {
> - format_byte_out(r, KBYTE * (float) kbcount / (float) up_time);
> + format_byte_out(r, (unsigned long)
> + (KBYTE * (float) kbcount / (float) up_time));
> rputs("/second - ", r);
> }
>
> if (count > 0) {
> - format_byte_out(r, KBYTE * (float) kbcount / (float) count);
> + format_byte_out(r, (unsigned long)
> + (KBYTE * (float) kbcount / (float) count));
> rputs("/request", r);
> }
>
>
>
Re: [PATCH] mod_status warnings
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Paul Sutton wrote:
>
> Well, the patches weren't in STATUS. Even if they were, when making a
> comment on a patch surely it is better to address that to the list, rather
> than placing it in the STATUS commit log?
D'oh!
#ken P-)}
Re: [PATCH] mod_status warnings
Posted by Paul Sutton <pa...@eu.c2.net>.
On Sat, 10 Jan 1998, Rodent of Unusual Size wrote:
> Paul Sutton wrote:
> > On Fri, 9 Jan 1998, Marc Slemko wrote:
> :
> > +1
>
> If you've got CVS access, *please* update STATUS directly with your
> votes rather than replying in mail.. Or at least do both. Since STATUS
> doesn't have a single maintainer any more, your vote is probably not
> going to be recorded there unless *you* do it.
Well, the patches weren't in STATUS. Even if they were, when making a
comment on a patch surely it is better to address that to the list, rather
than placing it in the STATUS commit log?
//pcs
Re: [PATCH] mod_status warnings
Posted by Marc Slemko <ma...@worldgate.com>.
On Sat, 10 Jan 1998, Rodent of Unusual Size wrote:
> Paul Sutton wrote:
> >
> > On Fri, 9 Jan 1998, Marc Slemko wrote:
> :
> > +1
>
> If you've got CVS access, *please* update STATUS directly with your
> votes rather than replying in mail.. Or at least do both. Since STATUS
> doesn't have a single maintainer any more, your vote is probably not
> going to be recorded there unless *you* do it.
So?
Re: [PATCH] mod_status warnings
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Paul Sutton wrote:
>
> On Fri, 9 Jan 1998, Marc Slemko wrote:
:
> +1
If you've got CVS access, *please* update STATUS directly with your
votes rather than replying in mail.. Or at least do both. Since STATUS
doesn't have a single maintainer any more, your vote is probably not
going to be recorded there unless *you* do it.
Of course, if you vote and don't have CVS access, please remember to
ask someone to update STATUS on your behalf when you reply with a
vote.
#ken P-)}
Re: [PATCH] mod_status warnings
Posted by Paul Sutton <pa...@eu.c2.net>.
On Fri, 9 Jan 1998, Marc Slemko wrote:
> Index: mod_status.c
> ===================================================================
> RCS file: /export/home/cvs/apachen/src/modules/standard/mod_status.c,v
> retrieving revision 1.70
> diff -u -r1.70 mod_status.c
> --- mod_status.c 1998/01/07 16:46:57 1.70
> +++ mod_status.c 1998/01/10 04:44:30
> @@ -364,12 +364,14 @@
> (float) count / (float) up_time);
>
> if (up_time > 0) {
> - format_byte_out(r, KBYTE * (float) kbcount / (float) up_time);
> + format_byte_out(r, (unsigned long)
> + (KBYTE * (float) kbcount / (float) up_time));
> rputs("/second - ", r);
> }
+1