This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
atoi vs strtol in rtl.c:read_rtx()
- To: gcc at gcc dot gnu dot org
- Subject: atoi vs strtol in rtl.c:read_rtx()
- From: DJ Delorie <dj at redhat dot com>
- Date: Thu, 24 May 2001 16:34:10 -0400
Is there any reason not to use strtol() here? Or at least abort if
the clueless developer (me ;) puts hex constants in the md file?
case 'w':
read_name (tmp_char, infile);
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
tmp_wide = atoi (tmp_char);
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
tmp_wide = atol (tmp_char);
#else
/* Prefer atoll over atoq, since the former is in the ISO C99 standard.
But prefer not to use our hand-rolled function above either. */
#if defined(HAVE_ATOLL) || !defined(HAVE_ATOQ)
tmp_wide = atoll (tmp_char);
#else
tmp_wide = atoq (tmp_char);
#endif
#endif
#endif
XWINT (return_rtx, i) = tmp_wide;
break;
case 'i':
case 'n':
read_name (tmp_char, infile);
tmp_int = atoi (tmp_char);
XINT (return_rtx, i) = tmp_int;
break;