Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 29904 invoked by uid 6000); 17 Jan 1998 15:37:20 -0000 Received: (qmail 29898 invoked from network); 17 Jan 1998 15:37:18 -0000 Received: from gaia.vr.net (lundberg@205.133.13.5) by taz.hyperreal.org with SMTP; 17 Jan 1998 15:37:18 -0000 Received: from localhost (lundberg@localhost) by gaia.vr.net (8.8.5/8.8.5) with SMTP id KAA16776 for ; Sat, 17 Jan 1998 10:37:15 -0500 Date: Sat, 17 Jan 1998 10:37:15 -0500 (EST) From: Gregory A Lundberg To: new-httpd@apache.org Subject: Re: warnings on Solaris In-Reply-To: <34C0C02F.22C6DEA6@algroup.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org On Sat, 17 Jan 1998, Ben Laurie wrote: > This is the same as const x **. Did you mean something like const x > const ** (or do I mean const x * const *?)? I always find parenthesis good at this point. If you mean a pointer, which I cannot change, to a pointer which I can change, try: const (x *) * or x * const * I think the first is more correct, but on some compilers I've had trouble with it and found they wanted the second form. Since we're worried about portability, I'd suggest clarifying the issue with some typedefs. typedef const int cint; /* const int */ typedef cint * cintptr; /* var ptr to const int */ typedef const cintptr cintcptr; /* const ptr to const int */ cintcptr * x ; /* var ptr to const ptr to const int */ const cintcptr * y; /* const ptr to const ptr to const int */ Unrolling this yields const const int * * x; const const const int * * y; which _should_ work but confuses some compilers (and most programmers) so let's stick with typedefs. While casts are Bad Things, typedefs are Good Things. They are so good that with some lints you can have them treated as completely new types and get warnings about assigning a squarepeg to a roundhole even though both are typedef'd void* underneath. Betcha if Apache used 'em everywhere the warnings list from the nightly builds 'd fill a filesystem :P ---- Gregory A Lundberg Senior Partner, VRnet Company 1441 Elmdale Drive email: lundberg@vr.net [205.133.13.8] Kettering, OH 45409-1615 USA voice: +1 (937) 299-7653