bugAVR C Runtime Library - Bugs: bug #35366, Bad behaviour for fprintf_P...

 
 

bug #35366: Bad behaviour for fprintf_P function

Submitted by:  Damien Espitallier <espitall>
Submitted on:  Wed 25 Jan 2012 01:28:32 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: libc code
Status: Works For MePercent Complete: 0%
Assigned to: NoneOpen/Closed: Closed
Release: 1.7.1Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 30 Jan 2012 09:25:35 AM UTC, comment #2:

I haven't the bug with your test files.
I've probably wasted your time for a bug in my own code, even if I really don't see where.

You can close this bug, if I can reproduce with your test files, I will reopen the bug.

Really sorry.

Damien Espitallier <espitall>
Sat 28 Jan 2012 05:38:55 AM UTC, comment #1:

Hm... I can not reproduce this behavior.
The attempts are added to Avr-libc:
tests/regression/bug-35366-*.c

Dmitry Xmelkov <dmix>
Project Administrator
Wed 25 Jan 2012 01:28:32 PM UTC, original submission:

In order to print a single '%' character with fprintf_P, I must put %%%% in my format string.

A string format "e1=%f %% e2=%f" seems to be interpreted as if I wrote "e1=%f % e2=%f" (which create a false %e token and corrupt my output)

It seems that the string format is parsed twice, so the only way I found to have my single % is to add two extra %

The vnsprintf function has the same bug (but not the simple printf function)

I use the 1.7.1 version provided by atmel but I didn't see any trace of this bug in changelog of newer versions.

Damien Espitallier <espitall>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by dmix (Posted a comment)
  • -unavailable- added by espitall (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 30 Jan 2012 05:39:03 PM UTCarcanumStatusNone=>Works For Me
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1