Opened 9 years ago

Closed 8 years ago

#11991 closed enhancement (fixed)

[Patch] Fix GCC 5 narrowing conversion warning.

Reported by: mt Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

GCC 5 (5.1.0-RC-20150412) reports.

C++ /home/haiku/haiku/haiku/generated-gcc5/objects/haiku/x86/release/add-ons/kernel/bus_managers/firewire/fwohci_pci.o 
/home/haiku/haiku/haiku/src/add-ons/kernel/bus_managers/firewire/fwohci.cpp:90:58: error: narrowing conversion of '-2147483648' from 'int' to 'uint32_t {aka unsigned int}' inside { }
 uint32_t tagbit[4] = { 1 << 28, 1 << 29, 1 << 30, 1 << 31};
                                                          ^

Attachments (1)

0003-Fix-GCC-5-narrowing-conversion-warning.patch (925 bytes ) - added by mt 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by mt, 9 years ago

patch: 01

comment:2 by pulkomandy, 9 years ago

Isn't it better to use "1u << 31" ?

comment:3 by korli, 9 years ago

Yes it is.

comment:4 by pulkomandy, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev49747.

Note: See TracTickets for help on using tickets.