mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-25 11:54:01 +08:00
re PR fortran/38504 (double minus sign when printing integer?)
2008-12-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/38504 io/write.c (write_decimal): Skip extra sign '-' at beginning of string returned by gfc_itoa. From-SVN: r142747
This commit is contained in:
parent
7b5be687fc
commit
07e9d8beb7
@ -1,3 +1,9 @@
|
||||
2008-12-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libfortran/38504
|
||||
io/write.c (write_decimal): Skip extra sign '-' at beginning of string
|
||||
returned by gfc_itoa.
|
||||
|
||||
2008-12-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libfortran/38430
|
||||
|
@ -600,9 +600,16 @@ write_decimal (st_parameter_dt *dtp, const fnode *f, const char *source,
|
||||
sign = calculate_sign (dtp, n < 0);
|
||||
if (n < 0)
|
||||
n = -n;
|
||||
|
||||
nsign = sign == S_NONE ? 0 : 1;
|
||||
|
||||
/* conv calls gfc_itoa which sets the negative sign needed
|
||||
by write_integer. The sign '+' or '-' is set below based on sign
|
||||
calculated above, so we just point past the sign in the string
|
||||
before proceeding to avoid double signs in corner cases.
|
||||
(see PR38504) */
|
||||
q = conv (n, itoa_buf, sizeof (itoa_buf));
|
||||
if (*q == '-')
|
||||
q++;
|
||||
|
||||
digits = strlen (q);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user