[PATCH PR/42686] Align the help text output
Shujing Zhao
pearly.zhao@oracle.com
Mon Mar 15 09:28:00 GMT 2010
On 03/13/2010 12:59 AM, Joseph S. Myers wrote:
> On Fri, 12 Mar 2010, Shujing Zhao wrote:
>
>> +/* Return the really width needed when left-justify print
>> + the MSGSTR which came from gettext with the column width ROOM. */
>
> I still can't make sense of this comment, and can't review the patch
> without clear English comments explaining the semantics of the various
> functions. What is "the really width"? Needed for that? What is "when
> left-justify print"? What is "column width ROOM"?
>
yes, it looks quite confused now...
> If this is something to do with the peculiarities of printf functions
> (counting bytes, when you are concerned with columns for alignment), you
> might wish to consider simply not using printf width functionality with
> strings that may contain non-1-column characters. Output a certain number
> of bytes of the help text in one call, and a certain number of spaces in
> another call, and include clear comments explaining the printf
> peculiarities that are the reason for doing so.
>
Yes. Breaking the printf makes the code clearer and easier. Thanks to point out
it. At the new patch, I broke the printf into output item and output help
string. The code to output the item that includes wide character is moved back
to opts.c, for it doesn't use any wcs functions. The others are kept with the
old patch.
Thanks for your patience reviewing the patches.
Is it OK?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03151650.patch
Type: text/x-patch
Size: 6061 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100315/452d47ef/attachment.bin>
More information about the Gcc-patches
mailing list