Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #4594
Closed
Open
Issue created Dec 08, 2020 by Derek Bruening@derekbrueningContributor

a64 release build failures with gcc 10: zero-sized arrays

Xref Visual Studio hitting similar errors about zero-sized arrays at https://github.com/DynamoRIO/dynamorio/issues/1684#issuecomment-648931235

$ /usr/bin/aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Debian 10.2.0-9) 10.2.0
$ rm -rf *; cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../src/make/toolchain-arm64.cmake ../src; ninja dynamorio
[69/104] Building C object core/CMakeFiles/dynamorio.dir/arch/clean_call_opt_shared.c.o   
FAILED: core/CMakeFiles/dynamorio.dir/arch/clean_call_opt_shared.c.o 
/usr/bin/aarch64-linux-gnu-gcc -Ddynamorio_EXPORTS -I/home/bruening/dr/git/src/core/drlibc -I/home/bruening/dr/git/src/core/ir/aarch64 -I/home/bruening/dr/git/src/core/arch/aarch64 -I/home/bruening/dr/git/src/core/unix -I/home/bruening/dr/git/src/core/ir -I/home/bruening/dr/git/src/core/arch -I/home/bruening/dr/git/src/core/lib -I. -fno-strict-aliasing -fno-stack-protector -fvisibility=internal  -std=gnu99 -fno-unwind-tables -O3 -g3 -Wall -Werror -Wwrite-strings -Wno-unused-but-set-variable -Wno-stringop-truncation -Wno-format-truncation -Wno-stringop-overflow -fPIC -MD -MT core/CMakeFiles/dynamorio.dir/arch/clean_call_opt_shared.c.o -MF core/CMakeFiles/dynamorio.dir/arch/clean_call_opt_shared.c.o.d -o core/CMakeFiles/dynamorio.dir/arch/clean_call_opt_shared.c.o -c /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c                                                                                                                         
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c: In function ‘analyze_clean_call’:                                             
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:81:24: error: array subscript ‘(<unknown>) + -1’ is outside the bounds of an interior zero-length array ‘bool[0]’ {aka ‘_Bool[]’} [-Werror=zero-length-bounds]                                                                             
   81 |         ci->opmask_used[i] = true;                               
      |         ~~~~~~~~~~~~~~~^~~
In file included from /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:42:                                                      
/home/bruening/dr/git/src/core/arch/arch.h:1463:10: note: while referencing ‘opmask_used’                                                  
 1463 |     bool opmask_used[MCXT_NUM_OPMASK_SLOTS];                          
      |          ^~~~~~~~~~~                                                  
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:81:24: error: array subscript ‘(<unknown>) + -1’ is outside the bounds of an interior zero-length array ‘bool[0]’ {aka ‘_Bool[]’} [-Werror=zero-length-bounds]                                                                             
   81 |         ci->opmask_used[i] = true;
      |         ~~~~~~~~~~~~~~~^~~
In file included from /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:42:                                                      
/home/bruening/dr/git/src/core/arch/arch.h:1463:10: note: while referencing ‘opmask_used’                                                  
 1463 |     bool opmask_used[MCXT_NUM_OPMASK_SLOTS];
      |          ^~~~~~~~~~~                                                  
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:517:30: error: array subscript ‘(<unknown>) + -1’ is outside the bounds of an interior zero-length array ‘bool[0]’ {aka ‘_Bool[]’} [-Werror=zero-length-bounds]                                                                            
  517 |         if (info->opmask_used[i]) {                          
      |             ~~~~~~~~~~~~~~~~~^~~                                      
In file included from /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:42:                                                      
/home/bruening/dr/git/src/core/arch/arch.h:1463:10: note: while referencing ‘opmask_used’                                                  
 1463 |     bool opmask_used[MCXT_NUM_OPMASK_SLOTS];
      |          ^~~~~~~~~~~                                                  
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:523:29: error: array subscript ‘(<unknown>) + -1’ is outside the bounds of an interior zero-length array ‘bool[0]’ {aka ‘_Bool[]’} [-Werror=zero-length-bounds]                                                                            
  523 |             cci->opmask_skip[i] = true;                               
      |             ~~~~~~~~~~~~~~~~^~~                                       
In file included from /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:42:                                                      
/home/bruening/dr/git/src/core/arch/arch.h:412:10: note: while referencing ‘opmask_skip’                                                   
  412 |     bool opmask_skip[MCXT_NUM_OPMASK_SLOTS];                          
      |          ^~~~~~~~~~~
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:518:29: error: array subscript ‘(<unknown>) + -1’ is outside the bounds of an interior zero-length array ‘bool[0]’ {aka ‘_Bool[]’} [-Werror=zero-length-bounds]                                                                            
  518 |             cci->opmask_skip[i] = false;                              
      |             ~~~~~~~~~~~~~~~~^~~                                       
In file included from /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:42:                                                      
/home/bruening/dr/git/src/core/arch/arch.h:412:10: note: while referencing ‘opmask_skip’                                                   
  412 |     bool opmask_skip[MCXT_NUM_OPMASK_SLOTS];                          
      |          ^~~~~~~~~~~
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c: In function ‘clean_call_opt_init’:                                            
/home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:81:24: error: array subscript ‘(<unknown>) + -1’ is outside the bounds of an interior zero-length array ‘bool[0]’ {aka ‘_Bool[]’} [-Werror=zero-length-bounds]                                                                             
   81 |         ci->opmask_used[i] = true;                                    
      |         ~~~~~~~~~~~~~~~^~~
In file included from /home/bruening/dr/git/src/core/arch/clean_call_opt_shared.c:42:                                                      
/home/bruening/dr/git/src/core/arch/arch.h:1463:10: note: while referencing ‘opmask_used’                                                  
 1463 |     bool opmask_used[MCXT_NUM_OPMASK_SLOTS];                          
      |          ^~~~~~~~~~~   
/home/bruening/dr/git/src/core/arch/arch.h:1478:22: note: defined here ‘default_callee_info’                                               
 1478 | extern callee_info_t default_callee_info;                             
      |                      ^~~~~~~~~~~~~~~~~~~                              
cc1: all warnings being treated as errors   
Assignee
Assign to
Time tracking