Opened 4 months ago

Closed 6 weeks ago

#14319 closed bug (fixed)

UserlandFSDefs.h: Fix gcc8 build

Reported by: mt Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: File Systems/UserlandFS Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

https://review.haiku-os.org/#/c/haiku/+/428/

Remove index of portInfos[] in struct fs_init_info [1], since gcc8 warns -Werror=array-bounds in UserlandFSServer::_Announce().

[1] https://git.haiku-os.org/haiku/tree/headers/private/userlandfs/private/UserlandFSDefs.h#n18

C++ /home/haiku/haiku/haiku/generated-gcc8/objects/haiku/x86_64/release/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.o 
/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp: In member function 'status_t UserlandFS::UserlandFSServer::_Announce(const char*, port_id)':
/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp:192:21: error: array subscript 0 is above array bounds of 'UserlandFSUtil::Port::Info [0]' [-Werror=array-bounds]
  info->portInfos[0] = *fNotificationRequestPort->GetPortInfo();
  ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp:194:26: error: array subscript 0 is above array bounds of 'UserlandFSUtil::Port::Info [0]' [-Werror=array-bounds]
   info->portInfos[i + 1] = *fRequestThreads[i].GetPortInfo();
   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Change History (1)

comment:1 Changed 6 weeks ago by korli

Resolution: fixed
Status: newclosed

merged in hrev52182

Note: See TracTickets for help on using tickets.