Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !287

Fix warning phm

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Thomas Koopman requested to merge thomas/sac2c:array-bounds-warning into develop Mar 05, 2024
  • Overview 0
  • Commits 1
  • Changes 1

gcc 13.2.0 gives warnings like

/home/thomas/repos/sac2c/src/libsacphm/compat/malloc.c: In function ‘memalign’:
/home/thomas/repos/sac2c/build_CFAL/include/runtime/phm_h/phm.h:125:56: warning: array subscript -1 is outside array bounds of ‘void[]’ [-Warray-bounds]
  125 | #define SAC_HM_LARGECHUNK_ARENA(header) (((header) + 1)->data1.arena)

This is not an error as there is bookkeeping information in front of the chunks, but gcc does not know that the memory was allocated by the phm version of malloc instead of the system malloc.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: array-bounds-warning