Opened 9 years ago

Closed 9 years ago

#5228 closed bug (fixed)

Wrong format specifiers break debug build

Reported by: daniel.is.fischer 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:

Description

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 daniel.is.fischer 9 years ago.
trailing whitespace
0002-Fix-format-specifiers.patch (1.4 KB) - added by daniel.is.fischer 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by daniel.is.fischer

Attachment: 0001-Whitespace-only.patch added

trailing whitespace

Changed 9 years ago by daniel.is.fischer

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).

changeset:aa538c1db99be4efb2724bb8c4a378b9d68a28ec

comment:4 Changed 9 years ago by daniel.is.fischer

Owner: simonmar deleted
Resolution: fixed
Status: closednew

Forgot one:

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

rts/Trace.c:270:13:
     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 daniel.is.fischer

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