* [9fans] Unexpected complaint
@ 2013-04-02 6:54 lucio
2013-04-02 7:02 ` Yaroslav
0 siblings, 1 reply; 5+ messages in thread
From: lucio @ 2013-04-02 6:54 UTC (permalink / raw)
To: 9fans
The following code triggers a warning:
#include <u.h>
#include <libc.h>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] Unexpected complaint
2013-04-02 6:54 [9fans] Unexpected complaint lucio
@ 2013-04-02 7:02 ` Yaroslav
2013-04-02 7:27 ` lucio
0 siblings, 1 reply; 5+ messages in thread
From: Yaroslav @ 2013-04-02 7:02 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
[-- Attachment #1: Type: text/plain, Size: 622 bytes --]
works as expected if given "%llud" format.
2013/4/2 <lucio@proxima.alt.za>
> The following code triggers a warning:
>
> #include <u.h>
> #include <libc.h>
>
> 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
[-- Attachment #2: Type: text/html, Size: 1085 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] Unexpected complaint
2013-04-02 7:02 ` Yaroslav
@ 2013-04-02 7:27 ` lucio
2013-04-02 8:15 ` Charles Forsyth
0 siblings, 1 reply; 5+ messages in thread
From: lucio @ 2013-04-02 7:27 UTC (permalink / raw)
To: 9fans
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] Unexpected complaint
2013-04-02 7:27 ` lucio
@ 2013-04-02 8:15 ` Charles Forsyth
2013-04-02 8:18 ` lucio
0 siblings, 1 reply; 5+ messages in thread
From: Charles Forsyth @ 2013-04-02 8:15 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
[-- Attachment #1: Type: text/plain, Size: 170 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 466 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [9fans] Unexpected complaint
2013-04-02 8:15 ` Charles Forsyth
@ 2013-04-02 8:18 ` lucio
0 siblings, 0 replies; 5+ messages in thread
From: lucio @ 2013-04-02 8:18 UTC (permalink / raw)
To: 9fans
> 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,
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-02 8:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-02 6:54 [9fans] Unexpected complaint lucio
2013-04-02 7:02 ` Yaroslav
2013-04-02 7:27 ` lucio
2013-04-02 8:15 ` Charles Forsyth
2013-04-02 8:18 ` lucio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).