Opened 9 years ago

Closed 9 years ago

#5228 closed bug (fixed)

Wrong format specifiers break debug build

Reported by: Owned by:
Priority: high Milestone: 7.2.1
Component: Runtime System Version: 7.1
Keywords: format specifiers, validate Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


In rts/Trace.c, in the function traceCapsetModify_, the format specifiers were "%d", but they should be "%lu" since StgWord32 and (via that) CapsetID are typedef'ed to unsigned long. The code is conditional, only alive if DEBUG is defined, so it only breaks debug builds. Patch(es) attached.

Attachments (2)

0001-Whitespace-only.patch (4.0 KB) - added by 9 years ago.
trailing whitespace
0002-Fix-format-specifiers.patch (1.4 KB) - added by 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by

Attachment: 0001-Whitespace-only.patch added

trailing whitespace

Changed 9 years ago by

comment:1 Changed 9 years ago by igloo

Status: newpatch

comment:2 Changed 9 years ago by simonmar

Milestone: 7.2.1
Owner: set to simonmar
Priority: normalhigh

comment:3 Changed 9 years ago by simonmar

Resolution: fixed
Status: patchclosed

Fixed (but differently, the trick is to cast the arguments to fix this in a platform-independent way).


comment:4 Changed 9 years ago by

Owner: simonmar deleted
Resolution: fixed
Status: closednew

Forgot one:

cc1: warnings being treated as errors
rts/Trace.c: In Funktion »traceCapsetModify_«:

     Fehler: format »%d« erwartet Typ »int«, aber Argument 3 hat Typ »StgWord32«
gmake[1]: *** [rts/dist/build/Trace.debug_o] Fehler 1
gmake: *** [all] Fehler 2

comment:5 Changed 9 years ago by

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.