Opened 4 years ago

Closed 3 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:
Has a Patch: yes 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 4 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 4 years ago by mt

Has a Patch: set

comment:2 Changed 3 years ago by pulkomandy

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

comment:3 Changed 3 years ago by korli

Yes it is.

comment:4 Changed 3 years ago by pulkomandy

Resolution: fixed
Status: newclosed

Fixed in hrev49747.

Note: See TracTickets for help on using tickets.