[gfortran] Patch for PR 14055

Feng Wang wf_cs@yahoo.com
Wed Mar 10 02:02:00 GMT 2004


> Index: gcc/gcc/fortran/arith.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/fortran/Attic/arith.c,v
> retrieving revision 1.1.2.3
> diff -c -3 -p -r1.1.2.3 arith.c
> *** gcc/gcc/fortran/arith.c     29 Aug 2003 19:18:33 -0000      1.1.2.3
> --- gcc/gcc/fortran/arith.c     6 Mar 2004 19:39:51 -0000
> *************** gfc_expr *
> *** 2426,2434 ****
>   gfc_convert_integer (const char *buffer, int kind, int radix, locus *
> where)
>   {
>     gfc_expr *e;
>    
>     e = gfc_constant_result (BT_INTEGER, kind, where);
> !   mpz_set_str (e->value.integer, buffer, radix);
>    
>     return e;
>   }
> --- 2426,2440 ----
>   gfc_convert_integer (const char *buffer, int kind, int radix, locus *
> where)
>   {
>     gfc_expr *e;
> +   const char *t;
>    
>     e = gfc_constant_result (BT_INTEGER, kind, where);
> !   /* a leading plus is allowed, but not by mpz_set_str */
> !   if (buffer[0] == '+')
> !     t = buffer + 1;

I think this should add an explicit type conversion to get rid off the
compiling warnings. As: t = (char *)(buffer + 1);

> !   else
> !     t = buffer;

Ditto.

> !   mpz_set_str (e->value.integer, t, radix);
>    
>     return e;
>   }
> *************** gfc_expr *
> *** 2440,2448 ****
>   gfc_convert_real (const char *buffer, int kind, locus * where)
>   {
>     gfc_expr *e;
>    
>     e = gfc_constant_result (BT_REAL, kind, where);
> !   mpf_set_str (e->value.real, buffer, 10);
>    
>     return e;
>   }
> --- 2446,2460 ----
>   gfc_convert_real (const char *buffer, int kind, locus * where)
>   {
>     gfc_expr *e;
> +   const char *t;
>    
>     e = gfc_constant_result (BT_REAL, kind, where);
> !   /* a leading plus is allowed, but not by mpf_set_str */
> !   if (buffer[0] == '+')
> !     t = buffer + 1;

Ditto.

> !   else
> !     t = buffer;

Ditto.

> !   mpf_set_str (e->value.real, t, 10);
>    
>     return e;
>   }

regards,
Feng Wang

_________________________________________________________
Do You Yahoo!? 
ÍêÈ«Ãâ·ÑµÄÑÅ»¢µçÓÊ£¬ÂíÉÏ×¢²á»ñÔù¶îÍâ60Õ×ÍøÂç´æ´¢¿Õ¼ä
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.mail.yahoo.com



More information about the Fortran mailing list