Bug 1783 - printf %hhd is broken
Summary: printf %hhd is broken
Status: RESOLVED FIXED
Alias: None
Product: uClibc
Classification: Unclassified
Component: stdio (show other bugs)
Version: 0.9.31
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: Carmelo Amoroso
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 01:22 UTC by Michael Deutschmann
Modified: 2011-06-17 13:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Patch to fix printf hhd conversion (563 bytes, patch)
2010-05-19 01:22 UTC, Michael Deutschmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Deutschmann 2010-05-19 01:22:22 UTC
Created attachment 1753 [details]
Patch to fix printf hhd conversion

The %hhd printf conversion is treated identically to %hhu.  This causes "255" to be output instead of "-1".

This misbehavior causes a spurious test failure in the MPFR library.

This is a regression from 0.9.30.3, but the change that caused the problem isn't actually in the stdio files.  It happens because uClibc is now built with -funsigned-char.

Attached is a fix that changes a critical cast from "(char)" to "(signed char)", restoring the original semantics.
Comment 1 Carmelo Amoroso 2010-05-19 05:18:22 UTC
Thanks Michael,
please next time try to use git to format patch.
Comment 2 Carmelo Amoroso 2010-05-19 05:22:25 UTC
Applied on master.

Thanks
Comment 3 Michael Deutschmann 2011-06-17 13:19:34 UTC
uClibc 0.9.32 doesn't contain this fix.

The old patch still applies.