Opened 6 years ago

Closed 6 years ago

#11564 closed bug (fixed)

Removed implicit conversion to int32 (CID 1251478)

Reported by: tgkokk Owned by: nobody
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/Development
Keywords: gci2014 Cc:
Blocked By: Blocking:
Platform: All


In /src/bin/screeninfo.cpp, screen.ID() is returning a struct with an int32 field id but the printf argument is the whole struct. I guess that printf is smart and retrieves the struct's only field.

Attachments (1)

0002-Removed-implicit-conversion-to-int32-CID-1251478.patch (753 bytes ) - added by tgkokk 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by tgkokk, 6 years ago

patch: 01

comment:2 by pulkomandy, 6 years ago

Hi, The fix is incomplete. Since id is an int32, you should use B_PRId32 instead of d for the format, like this:

printf("Screen %" B_PRId32 ":", screen.ID().id); 

This way the code will compile without warnings on 32bit and 64bit systems, with the macro expanding to "ld" and "d", respectively.

comment:3 by tgkokk, 6 years ago

OK, I've changed it.

comment:4 by pulkomandy, 6 years ago

Resolution: fixed
Status: newclosed

Applied in hrev48432.

Note: See TracTickets for help on using tickets.