Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14319 closed bug (fixed)

UserlandFSDefs.h: Fix gcc8 build

Reported by: mt Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: File Systems/UserlandFS Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
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 (2)

comment:1 by korli, 6 years ago

Resolution: fixed
Status: newclosed

merged in hrev52182

comment:2 by nielx, 5 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.