Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 128622 - glibc printf length modifier (h) bug when using integer conversion (i)
Summary: glibc printf length modifier (h) bug when using integer conversion (i)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://sources.redhat.com/bugzilla/sh...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-03 03:53 UTC by Yo. E
Modified: 2006-05-02 19:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yo. E 2006-04-03 03:53:39 UTC
Let's consider following code:

#include <stdio.h>

int main () {
  printf("%hi\n", 0xffff0010);
  return 0;
}

It gives "-65520" on several Linux systems with libc 6 (particularly in Gentoo Linux), but on FreeBSD with libc 4 and different versions of msvc gives "16". The same thing with hh length modifier (higher bits are not cutted off according to length modifier).
Comment 1 SpanKY gentoo-dev 2006-04-03 09:27:30 UTC
oddly enough, %hu works as expected :)

i'll report this upstream
Comment 2 SpanKY gentoo-dev 2006-05-02 19:29:51 UTC
this has been fixed upstream and i'll add it to glibc-2.4-r2 and glibc-2.3.6-r4