Opened 11 years ago

Closed 11 years ago

#2953 closed bug (fixed)

Wrong printf-flag in log message

Reported by: Adek336 Owned by: axeld
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

src/system/kernel/int.c

    219 			} else {
    220 				// this is a shared interrupt vector, we cannot just disable it
-   221 				dprintf("More than 99%% interrupts of vector %d are unhandled\n",
+   221 				dprintf("More than 99\% interrupts of vector %d are unhandled\n",
    222 					vector);
    223 			}

I think this solves the erroneous log messages that go like

More than 99-1nterrupts of...

instead of

More than 99% interrupts of...

Change History (6)

comment:1 by anevilyak, 11 years ago

Mm, no, \% results in the compiler warning about incorrect number of arguments for format.

also %% works correctly with printf from userland code, so something else seems to be wrong here.

comment:2 by axeld, 11 years ago

Resolution: fixed
Status: newclosed

Indeed, "%%" is perfectly legal, just our vsnprintf() did not handle it correctly.

Fixed in hrev28323.

comment:3 by Adek336, 11 years ago

Resolution: fixed
Status: closedreopened

Doesn't yet work:

dprintf("ziom%%ziom\n");
dprintf("%% in\n");
dprintf("yo %% ziom\n");

yields

ziom%ziom
 1701523315n
yo %ziom

where the last two are wrong.

comment:4 by axeld, 11 years ago

Now that looks nice :-) I'll have another look, thanks for testing!

comment:5 by axeld, 11 years ago

Component: - GeneralSystem/Kernel

comment:6 by axeld, 11 years ago

Resolution: fixed
Status: reopenedclosed

You obviously tested with a wrong release, this all works flawlessly here.

Note: See TracTickets for help on using tickets.