Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • theora theora
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 33
    • Issues 33
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.Org
  • theoratheora
  • Issues
  • #2308
Closed
Open
Created Jan 30, 2018 by Brion Vibber (WMF)@bvibber

Several "warning: variable '...' may be uninitialized when used here" warnings with clang (Xcode 9.2 for iOS)

When building for iOS with Xcode 9.2 or 9.3 beta (clang) I get a number of warnings about values that the compiler can't verify are initialized at time of use.

Generally these are cases where one conditional branch initializes a local, another doesn't, and then follow-up code uses the local with some kind of conditional guard that the compiler doesn't grok, but it's nice to double-check and silence the warnings.

    - WARN  | xcodebuild:  libtheora/lib/decode.c:1586:24: warning: variable 'last_zzi' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/decode.c:1535:33: note: initialize the variable 'last_zzi' to silence this warning
    - WARN  | xcodebuild:  libtheora/lib/encfrag.c:104:26: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value]
    - NOTE  | xcodebuild:  libtheora/lib/encfrag.c:104:26: note: remove the call to 'abs' since unsigned values cannot be negative
    - WARN  | xcodebuild:  libtheora/lib/huffdec.c:308:10: warning: variable 'best_nbits' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/huffdec.c:280:17: note: initialize the variable 'best_nbits' to silence this warning
    - WARN  | xcodebuild:  libtheora/lib/quant.c:113:55: warning: variable 'plj' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/quant.c:101:18: note: initialize the variable 'plj' to silence this warning
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:637:42: warning: variable 'best_next' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:491:5: note: variable 'best_next' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:623:31: warning: variable 'best_token' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:492:5: note: variable 'best_token' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:623:65: warning: variable 'best_eb' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:493:5: note: variable 'best_eb' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:641:27: warning: variable 'best_bits' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:490:5: note: variable 'best_bits' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:642:25: warning: variable 'best_qc' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:494:5: note: variable 'best_qc' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:1191:16: warning: variable 'token1' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:1094:3: note: variable 'token1' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:1193:16: warning: variable 'eb1' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:1095:3: note: variable 'eb1' is declared here
    - WARN  | xcodebuild:  libtheora/lib/tokenize.c:1354:40: warning: variable 'ti' may be uninitialized when used here [-Wconditional-uninitialized]
    - NOTE  | xcodebuild:  libtheora/lib/tokenize.c:1331:5: note: variable 'ti' is declared here
Assignee
Assign to
Time tracking