Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix Clang warnings #2245

Merged
merged 1 commit into from
Jan 10, 2025
Merged

build: fix Clang warnings #2245

merged 1 commit into from
Jan 10, 2025

Conversation

rr-
Copy link
Collaborator

@rr- rr- commented Jan 10, 2025

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

Further cleanup for #2226.

  • Removes unused SPRITE_FLAG enums that I mistakenly looked up from TR2Main.

  • Removes 0 from all empty struct initializers. This syntax is supported since ISO C23 (see 6.7.10 Initialization):

    braced-initializer:
                        { }
                        { initializer-list }
                        { initializer-list , }
    

    An empty brace pair ({}) is called an empty initializer and is referred to as empty initialization

    Unfortunately we need -Wno-gnu-empty-initializer for Clang to recognize this.

  • Removes ambiguity in controller binding declarations (specifically, the bind union) by introducing separate macros for BT_BUTTON and BT_AXIS.

  • Adds -Wno-gnu-binary-literal to get Clang to recognize the binary literals, though this is also a part of the C23 standard. This has been fixed upstream, but has not yet found its way into our toolchain. Ref: [clang] Binary literals are flagged as a GNU extension even when compiling in C23 mode llvm/llvm-project#72017

  • Adds -Wno-gnu-zero-variadic-macro-arguments' to get the GLYPH_DEFINE macro to not produce invalid warnings. Passing zero variadic macro arguments is valid since C23. This has been fixed upstream, but has not yet found its way into our toolchain. Ref: Zero variable arguments should be allowed in C23 llvm/llvm-project#84495

  • Fixes one case of an unitialized variable usage.

@rr- rr- added the Internal The invisible stuff label Jan 10, 2025
@rr- rr- self-assigned this Jan 10, 2025
@rr- rr- requested review from a team as code owners January 10, 2025 12:13
@rr- rr- requested review from lahm86, walkawayy and aredfan and removed request for a team January 10, 2025 12:13
@rr- rr- merged commit 6ec0290 into develop Jan 10, 2025
8 checks passed
@rr- rr- deleted the build-cleanup branch January 10, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal The invisible stuff
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants