Article View: comp.lang.c.moderated
Article #2387Re: 'h' modifier in printf
From: Dan Pop
Date: Mon, 25 Mar 1996 12:22
Date: Mon, 25 Mar 1996 12:22
20 lines
1046 bytes
1046 bytes
In <4j06rd$82n@solutions.solon.com> holdp@essex.ac.uk (Holden P) writes:
>printf("Vanilla %X\nWith h %hX\n", -1, -1);
>
>says
>
>Vanilla FFFFFFFF
>With h FFFF
Since the type of -1 is not unsigned int and it appears in a context where
the compiler is not required to perform the conversion, this example
invokes undefined behaviour, hence it cannot be used to demonstrate
anything.
Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch
Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID:
<4j636q$3hm@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4i801c$455@solutions.solon.com> <4j06rd$82n@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: danpop@mail.cern.ch (Dan Pop) Newsgroups: comp.lang.c.moderated,comp.std.c Subject: Re: 'h' modifier in printf Date: 25 Mar 1996 06:22:50 -0600 Organization: CERN European Lab for Particle Physics Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4j636q$3hm@solutions.solon.com> References: <4i801c$455@solutions.solon.com> <4j06rd$82n@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Newsreader: NN version 6.5.0 #7 (NOV)