This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/5] Altera Nios II: hexadecimal numbers in options
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Chung-Lin Tang <cltang at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Sandra Loosemore <sandra at codesourcery dot com>
- Date: Thu, 25 Apr 2013 20:41:25 +0000
- Subject: Re: [PATCH 5/5] Altera Nios II: hexadecimal numbers in options
- References: <516FFA02 dot 3020405 at codesourcery dot com>
On Thu, 18 Apr 2013, Chung-Lin Tang wrote:
> 2013-04-18 Chung-Lin Tang <cltang@codesourcery.com>
>
> * opts-common.c (integral_argument): Add support for hexadecimal
> command option integer arguments. Update comments.
You should propose this sort of non-Nios II-specific change in a separate
thread with its own rationale for the change.
> + /* It wasn't a decimal number - try hexadecimal. */
> + if (arg[0]=='0' && (arg[1]=='x' || arg[1]=='X'))
Spacing around "==". I think you do need to check all the characters here
as is done for decimal arguments (but using ISXDIGIT), in order to ensure
that no locale-specific form is accepted by strtol.
--
Joseph S. Myers
joseph@codesourcery.com