This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFA: Add -ggo option


On Thu, 4 Nov 2010, Ian Lance Taylor wrote:

> +	  if (*p == '0' && (p[1] == 'x' || p[1] == 'X'))
> +	    {
> +	      p += 2;
> +	      is_hex = true;
> +	    }
> +	  while (ISDIGIT (*p) || *p == '.' || *p == 'e' || *p == 'E'
> +		 || (is_hex
> +		     && ((*p >= 'a' && *p <= 'f')
> +			 || (*p >= 'A' && *p <= 'F'))))
> +	    ++p;
> +	  memcpy (q, start, p - start);
> +	  q += p - start;
> +	  while (*p == 'u' || *p == 'U' || *p == 'l' || *p == 'L'
> +		 || *p == 'f' || *p == 'F'
> +		 || *p == 'd' || *p == 'D')
> +	    {
> +	      /* Go doesn't use any of these trailing type
> +		 modifiers.  */

I presume it's a deliberate choice here not to do anything about handling 
hex floats using 'p' with their exponents.

I don't see anything in this patch calling fclose on go_dump_file.  You 
should always call fclose and check the return value before exiting (or 
call fflush and ferror), so that errors can be detected, rather than lost 
if you rely on the implicit closing of files on exit.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]