uber / uber/h3

Clang warning in vertex.c

Open
#582 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
6.5k
Forks
627
Avg merge
3d 21h
Merged PRs (30d)
6

Description

Clang 11.0.0:

/tmp/h3/src/h3lib/lib/vertex.c: In function ‘vertexRotations’:
/tmp/h3/src/h3lib/lib/vertex.c:88:47: warning: ‘dirFaces.faces[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   88 |         if (cellLeadingDigit == JK_AXES_DIGIT &&
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   89 |             fijk.face ==
      |             ~~~~~~~~~~~~                       
   90 |                 dirFaces.faces[IK_AXES_DIGIT - DIRECTION_INDEX_OFFSET]) {
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h3/src/h3lib/lib/vertex.c:93:54: warning: ‘dirFaces.faces[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   93 |         } else if (cellLeadingDigit == IK_AXES_DIGIT &&
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   94 |                    fijk.face ==
      |                    ~~~~~~~~~~~~                       
   95 |                        dirFaces.faces[JK_AXES_DIGIT - DIRECTION_INDEX_OFFSET]) {
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in h3lib/lib/vertex.c at the vertexRotations function and reproduce the Clang 11.0.0 warning shown in the report. Determine why dirFaces.faces entries may be uninitialized and make the warning disappear without changing the intended behavior; done means the reported diagnostics no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.