From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <65e263b9ec88ad6c676a67ccaece92ff@proxima.alt.za> To: 9fans@9fans.net Date: Tue, 2 Apr 2013 08:54:21 +0200 From: lucio@proxima.alt.za MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] Unexpected complaint Topicbox-Message-UUID: 3c724080-ead8-11e9-9d60-3106f5b1d025 The following code triggers a warning: #include #include int main() { unsigned long long val = 0; print("VAL: %llu\n", val); return 0; } warning: llu.c:7 format mismatch llu UVLONG, arg 2 and produces the damnedest output: VAL: % %(not terminated by a newline). Something's not right, anybody know what the cause is? And maybe the cure? ++L From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <65e263b9ec88ad6c676a67ccaece92ff@proxima.alt.za> References: <65e263b9ec88ad6c676a67ccaece92ff@proxima.alt.za> Date: Tue, 2 Apr 2013 10:02:31 +0300 Message-ID: From: Yaroslav To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=bcaec5014c1d3d816304d95b52a9 Subject: Re: [9fans] Unexpected complaint Topicbox-Message-UUID: 3c7b10de-ead8-11e9-9d60-3106f5b1d025 --bcaec5014c1d3d816304d95b52a9 Content-Type: text/plain; charset=UTF-8 works as expected if given "%llud" format. 2013/4/2 > The following code triggers a warning: > > #include > #include > > int main() { > unsigned long long val = 0; > > print("VAL: %llu\n", val); > return 0; > } > > warning: llu.c:7 format mismatch llu > UVLONG, arg 2 > > and produces the damnedest output: > > VAL: % > %(not terminated by a newline). > > Something's not right, anybody know what the cause is? And maybe the > cure? > > ++L > > > -- - Yaroslav --bcaec5014c1d3d816304d95b52a9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
works as expected if given "%llud" format.
=


2013/4/2 <lucio@proxima.alt.za>
The following code triggers a warning:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 #include <u.h>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 #include <libc.h>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 int main() {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned long long = val =3D 0;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print("VAL: %l= lu\n", val);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

warning: llu.c:7 format mismatch llu
=C2=A0UVLONG, arg 2

and produces the damnedest output:

VAL: %
%(not terminated by a newline).

Something's not right, anybody know what the cause is? =C2=A0And maybe = the
cure?

++L





--
- Yaroslav
--bcaec5014c1d3d816304d95b52a9-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <2b3a6d9eb616ddf050b921fa79b2f3e6@proxima.alt.za> To: 9fans@9fans.net Date: Tue, 2 Apr 2013 09:27:44 +0200 From: lucio@proxima.alt.za In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Unexpected complaint Topicbox-Message-UUID: 3c85d5c8-ead8-11e9-9d60-3106f5b1d025 > works as expected if given "%llud" format. I thought I'd tried that (in another context) and the results were even more disappointing. I'll have to re-read the printf(2) man page... Thanks. ++L From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <2b3a6d9eb616ddf050b921fa79b2f3e6@proxima.alt.za> References: <2b3a6d9eb616ddf050b921fa79b2f3e6@proxima.alt.za> Date: Tue, 2 Apr 2013 09:15:11 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7bf1984420d70304d95c5675 Subject: Re: [9fans] Unexpected complaint Topicbox-Message-UUID: 3c8ce2d2-ead8-11e9-9d60-3106f5b1d025 --047d7bf1984420d70304d95c5675 Content-Type: text/plain; charset=UTF-8 On 2 April 2013 08:27, wrote: > I'll have to re-read the printf(2) man you're using print, not printf, and the conventions are different. --047d7bf1984420d70304d95c5675 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 2 April 2013 08:27, <lucio@proxima.alt.za> wrote:
=
I'll have to re-read the printf(2) man

you're= using print, not printf, and the conventions are different.
--047d7bf1984420d70304d95c5675-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <521961555e44c1c75d9651c15a8c6ead@proxima.alt.za> To: 9fans@9fans.net Date: Tue, 2 Apr 2013 10:18:50 +0200 From: lucio@proxima.alt.za In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Unexpected complaint Topicbox-Message-UUID: 3c9439d8-ead8-11e9-9d60-3106f5b1d025 > you're using print, not printf, and the conventions are different. I thought I wasn't totally insane! Thank you, Charles. ++L PS: Now I got to go back to the original instance of the problem and figure out what is the case there,