This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fix debug fprintf in avr.c
- From: Graham Stott <graham dot stott at btinternet dot com>
- To: Nick Clifton <nickc at redhat dot com>, denisc at overta dot ru, marekm at amelek dot gda dot pl
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Jul 2005 19:04:38 +0100 (BST)
- Subject: Re: RFA: Fix debug fprintf in avr.c
Hi Nick,
Isn't this changing one problem for another, '0' + something isn't
necessarily a printable character.
Why not just change the format specifier from %c to %d ?
Cheers
Graham
--- Nick Clifton <nickc@redhat.com> wrote:
> Hi Denis, Hi Marek,
>
> Please may I have permission to apply the small patch below ?
>
> It fixes the debug statement in avr.c:legitimate_address_p so that
> the character printed for the return value is a number and not some
> ASCII control character.
>
> Cheers
> Nick
>
> gcc/ChangeLog
> 2005-07-19 Nick Clifton <nickc@redhat.com>
>
> * config/avr/avr.c (legitimate_address_p): Fix debugging print
> statement to avoid displaying ASCII control characters.
>
> Index: gcc/config/avr/avr.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.c,v
> retrieving revision 1.139
> diff -c -3 -p -r1.139 avr.c
> *** gcc/config/avr/avr.c 2 Jul 2005 13:19:24 -0000 1.139
> --- gcc/config/avr/avr.c 19 Jul 2005 14:42:01 -0000
> *************** legitimate_address_p (enum machine_mode
> *** 950,956 ****
> }
> if (TARGET_ALL_DEBUG)
> {
> ! fprintf (stderr, " ret = %c\n", r);
> }
> return r == NO_REGS ? 0 : (int)r;
> }
> --- 950,956 ----
> }
> if (TARGET_ALL_DEBUG)
> {
> ! fprintf (stderr, " ret = %c\n", r + '0');
> }
> return r == NO_REGS ? 0 : (int)r;
> }
>
>