Subject: Re: warning: null format string
To: None <current-users@netbsd.org>
From: David Querbach <querbach@realtime.bc.ca>
List: current-users
Date: 03/06/2001 11:49:19
--ELM983908158-15849-0_
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

> >I'm playing around with netbsd for the first time, and have decided to
> >take the plunge and actually build and use -current. I noticed that some
> >effort is being made to make the source tree survive being run with gcc
> >-Werror. There seems to be a problem with things that pass NULL as the
> >format string to the <err.h> functions: 
> 
>       it is legal to pass NULL as format string to err() and friends.
>       not sure how we can workaround/fix this.

When cross-compiling using the pkgsrc compilers, I add

        export CWARNFLAGS="-Wno-format"

to the environment before running make.  This suppresses the null format
error messages.  Unfortunately it also suppresses warnings about invalid
arguments to printf and scanf.  

I read somewhere that egcs-1.2 (or whatever it will now be called) will
handle null format strings without complaint.

Regards,

David Querbach
Real-Time Systems Inc.

--ELM983908158-15849-0_
Content-Type: message/rfc822
Content-Disposition: inline
Content-Description: Forwarded message from querbach
Content-Transfer-Encoding: 7bit

Subject: Re: warning: null format string
In-Reply-To: <15137.983752849@coconut.itojun.org> from "itojun@iijlab.net" at
	"Mar 5, 2001 09:40:49 am"
To: itojun@iijlab.net
Date: Tue, 6 Mar 2001 09:59:15 -0800 (PST)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length:   895

> >I'm playing around with netbsd for the first time, and have decided to
> >take the plunge and actually build and use -current. I noticed that some
> >effort is being made to make the source tree survive being run with gcc
> >-Werror. There seems to be a problem with things that pass NULL as the
> >format string to the <err.h> functions: 
> 
> 	it is legal to pass NULL as format string to err() and friends.
> 	not sure how we can workaround/fix this.

When cross-compiling using the pkgsrc compilers, I add

	export CWARNFLAGS="-Wno-format"

to the environment before running make.  This suppresses the null format
error messages.  Unfortunately it also suppresses warnings about invalid
arguments to printf and scanf.  

I read somewhere that egcs-1.2 (or whatever it will now be called) will
handle null format strings without complaint.

Regards,

David Querbach
Real-Time Systems Inc.


--ELM983908158-15849-0_--