Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 1999 03:41:25 -0500 (EST)
From:      Brian Feldman <green@unixhelp.org>
To:        John Birrell <jb@cimlogic.com.au>
Cc:        Nate Williams <nate@mt.sri.com>, archie@whistle.com, wollman@khavrinen.lcs.mit.edu, current@FreeBSD.ORG
Subject:   Re: btokup() macro in sys/malloc.h
Message-ID:  <Pine.BSF.4.05.9901280334400.28225-100000@janus.syracuse.net>
In-Reply-To: <199901280558.QAA07918@cimlogic.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Jan 1999, John Birrell wrote:

> Nate Williams wrote:
> > > Anyway, if we're going to -Wall'ify the kernel (as we should)
> > > then we need to update sytle(9) to reflect that.
> > > 
> > > In fact, style(9) should say:
> > > 
> > >   If at all possible, your code should compile without warnings
> > >   when the gcc -Wall flag is given.
> > 
> > I disagree.  As has been shown many times in the past (and I suspect the
> > down-under constituent will show that at least a couple of the
> 
> I think you must mean the "Sydney-down-under constituent". There *is*
> a difference. 8-)
> 
> > 'warnings' fixes will be wrong and hide bogus code), making -Wall a goal
> > causes people to cover up bad code with bad casts and such.
> > 
> > '-Wall' is *NOT* a good design goal.
> 
> Fixing warnings with bad casts is a problem, sure, but asking people
> to write code without casts (if possible) that will compile cleanly with
> -Wall is a reasonable thing to ask IMO. In my experience, the resulting
> code tends to be more portable across architectures with different
> pointer/long sizes and endian-ness.
> 
> Just my 0.02, and I hate style(9) anyway.
> 

In cases, -Wall is bogus anyway. Here's one:
foo.c:89: warning: char format, void arg (arg 2)
        void *region;
                printf("mem open failed: %s\n", region);

According to standards, a void pointer may be freely used instead of any
other type of pointer, both as an lvalue and to assign to the other pointer.
Printf(), hence, wouldn't see a difference (of course). Gcc should not
complain about various void pointer things like this.

> -- 
> John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
> CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message
> 

 Brian Feldman					  _ __  ___ ___ ___  
 green@unixhelp.org			      _ __ ___ | _ ) __|   \ 
	     http://www.freebsd.org/	 _ __ ___ ____ | _ \__ \ |) |
 FreeBSD: The Power to Serve!	   _ __ ___ ____ _____ |___/___/___/ 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9901280334400.28225-100000>