Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 May 2002 12:27:14 -0700
From:      Peter Wemm <peter@wemm.org>
To:        "David E. O'Brien" <obrien@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/contrib/gcc c-format.c 
Message-ID:  <20020524192714.DC2033807@overcee.wemm.org>
In-Reply-To: <200205221637.g4MGb9e63421@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
"David E. O'Brien" wrote:
> obrien      2002/05/22 09:37:09 PDT
> 
>   Modified files:
>     contrib/gcc          c-format.c 
>   Log:
>   1/2assed reimplementation of c-common.c revs 1.2 (-fformat-extensions)
>   and 1.3 (printf0) for GCC 3.1.

This is not quite right:

peter@overcee[12:24pm]/tmp-169> cat foo.c
int
main(int ac, char **av)
{

        printf("%6D\n", (unsigned char *)"fake", ":");
        return 0;
}
peter@overcee[12:24pm]/tmp-170> cc -c -Wformat -c foo.c
foo.c: In function `main':
foo.c:5: warning: too many arguments for format

peter@overcee[12:25pm]/tmp-172> cat foo.c
int
main(int ac, char **av)
{

        printf("%D\n", (unsigned char *)"fake", ":");
        return 0;
}
peter@overcee[12:25pm]/tmp-173> cc -c -Wformat -c foo.c
peter@overcee[12:25pm]/tmp-174>

ie: it doesn't seem to like the size argument, which is clearly documented
in the comments and well used in the kernel.  eg:

../../../dev/an/if_an.c: In function `an_attach':
../../../dev/an/if_an.c:444: warning: too many arguments for format

Also:
../../../kern/tty_pty.c: In function `ptyinit':
../../../kern/tty_pty.c:158: warning: use of `' length modifier with `r' type character
../../../kern/tty_pty.c: In function `pty_clone':
../../../kern/tty_pty.c:860: warning: use of `' length modifier with `r' type character

I think this is the opposite problem to above.  %r appears to require a size
argument in the checking while %D appears to prohibit one.

Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020524192714.DC2033807>