This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Hexadecimal numbers in option arguments
- 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>
- Date: Sun, 14 Jul 2013 13:27:28 +0000
- Subject: Re: [PATCH] Hexadecimal numbers in option arguments
- References: <51E26A3C dot 7050606 at codesourcery dot com>
On Sun, 14 Jul 2013, Chung-Lin Tang wrote:
> Original patch posted as part of Nios II patches:
> http://gcc.gnu.org/ml/gcc-patches/2013-04/msg01087.html
>
> This patch is to allow hexadecimal numbers to be used in option
> arguments, e.g. -falign-loops=0x10 can now be used as equivalent to
> -falign-loops=16.
>
> Joseph, the patch has been modified to use IXDIGIT to check the argument
> string first, as you suggested in the last submission. Is this okay for
> trunk?
This version looks like it will allow plain "0x" or "0X" as an argument,
treating it as 0, rather than treating it as an error (i.e., you need to
check there is at least one hex digit after the "0x" or "0X" before
passing the string to strtol).
--
Joseph S. Myers
joseph@codesourcery.com