On Wed, 10 Jul 2002, Giorgos Keramidas wrote:

> On 2002-07-10 09:58 +0000, Dag-Erling Smorgrav wrote:
> > ===> bin/chmod
> > cc1: warnings being treated as errors
> > /usr/home/des/tinderbox/sparc64/src/bin/chmod/chmod.c: In function `main':
> > /usr/home/des/tinderbox/sparc64/src/bin/chmod/chmod.c:174: warning: null format 
>string
>
> How does this look for fixing this warning?
>
> %%%
> Index: chmod.c
> ===================================================================
> RCS file: /home/ncvs/src/bin/chmod/chmod.c,v
> retrieving revision 1.25
> diff -u -r1.25 chmod.c
> --- chmod.c   30 Jun 2002 05:13:52 -0000      1.25
> +++ chmod.c   10 Jul 2002 17:22:22 -0000
> @@ -171,7 +171,7 @@
>       }
>
>       if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL)
> -             err(1, NULL);
> +             err(1, "%s: %s", *argv, strerror(p->fts_errno));
>       for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
>               switch (p->fts_info) {
>               case FTS_D:                     /* Change it at FTS_DP. */
> %%%

The main bug is that the warning is emitted.  err(1, NULL) is perfectly
valid (see err(4)).  Apparently the sparc64 compiler is missing support
for __printf0like.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to