Skip to content

CTR: Fix type mismatch warning#79

Draft
Peter0x44 wants to merge 1 commit intonzp-team:mainfrom
Peter0x44:lto_mismatch_warning_array
Draft

CTR: Fix type mismatch warning#79
Peter0x44 wants to merge 1 commit intonzp-team:mainfrom
Peter0x44:lto_mismatch_warning_array

Conversation

@Peter0x44
Copy link
Copy Markdown
Contributor

@Peter0x44 Peter0x44 commented May 13, 2025

/home/peter/vril-engine/source/host.c:506:12: warning: type of 'perk_order' does not match original declaration [-Wlto-type-mismatch]
  506 | extern int perk_order[8];
      |            ^
/home/peter/vril-engine/source/cl_hud.c:1312:5: note: array types have different bounds
 1312 | int perk_order[9];
      |     ^

After reviewing this code, I have determined the correct fix is to make the length of the array 8. No code anywhere uses an index beyond 7.

Description of Changes

Change the array length in the definition to match the declaration.

Checklist


  • I have thoroughly tested my changes to the best of my ability
  • I confirm I have not contributed anything that would impact Nazi Zombies: Portable's licensing and usage
  • This Pull Request fixes a critical issue that should be reviewed and merged as soon as possible

/home/peter/vril-engine/source/host.c:506:12: warning: type of 'perk_order' does not match original declaration [-Wlto-type-mismatch]
  506 | extern int perk_order[8];
      |            ^
/home/peter/vril-engine/source/cl_hud.c:1312:5: note: array types have different bounds
 1312 | int perk_order[9];
      |     ^

After reviewing this code, I have determined the correct fix is to make the
size of the array 8. No code anywhere uses an index beyond 7.
@Peter0x44 Peter0x44 marked this pull request as draft May 13, 2025 06:18
@Peter0x44
Copy link
Copy Markdown
Contributor Author

actually, some PSP code seems to use 8 as an index. Needs a more careful look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant