This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/78959] FAIL: gcc.c-torture/execute/pr78622.c
- From: "danglin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Jan 2017 01:25:41 +0000
- Subject: [Bug middle-end/78959] FAIL: gcc.c-torture/execute/pr78622.c
- Auto-submitted: auto-generated
- References: <bug-78959-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78959
--- Comment #6 from John David Anglin <danglin at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #1)
> The test output
>
> "4105" => 4
>
> indicates that on HP-UX the %hhd directive doesn't convert the int argument
> (4105) to unsigned char to end up with 9 as the test expects. I think
> that's a bug in the HP-UX sprintf (do you have a way of reporting it and/or
> finding out if HP will fix it?), although there is/was some uncertainty
> about whether passing a value outside the range of char to %hhd is valid
> (https://groups.google.com/forum/#!topic/comp.std.c/evMVFdOufys).
snprintf returns a count of 4 and buf contains "4105". So, it looks like on
HP-UX 11.11 %hhd is being interpreted as %hd (a short integer conversion).
The %hhd form is not described in the 11.11 man page.