bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printf \xNNN


From: Paul Eggert
Subject: Re: printf \xNNN
Date: 25 Mar 2003 15:50:10 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

Jim Meyering <address@hidden> writes:

> I was surprised to see that according to POSIX,
> 
>   http://www.opengroup.org/onlinepubs/007904975/utilities/printf.html
> 
> printf does not recognize hexadecimal constants:

Yes, and that's why my POSIX-related patch of yesterday
<http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00094.html>
changed "*p == 'x'" to "!posixly_correct && (*p == 'x')".  (Hmm, sorry
about the redundant parentheses.  :-)

>   Hexadecimal character constants as defined in the ISO C standard are not
>   recognized in the format operand because there is no consistent way to
>   detect the end of the constant.

Yes, that's a problem.

> The current implementation is consistent (at least in this respect)
> with the one in bash's built-in printf command, so I think it's best
> to leave it the way it is, at least for the upcoming coreutils-5.0.
> What do you think?

There are good arguments both ways.  I can certainly understand your
leaving it the way that it is.

However, I would document the incompatibility with C.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]