Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • libhandy libhandy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 131
    • Issues 131
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • 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
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • Librem5
  • libhandylibhandy
  • Merge requests
  • !97

leaflet: initialize a variable

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jordan Petridis requested to merge alatiera/libhandy:leaflet-unitialized-variable into master Aug 10, 2018
  • Overview 7
  • Commits 1
  • Pipelines 4
  • Changes 1

while trying to compile libhandy, I bumped into a gcc warning.

[22/34] Compiling C object 'src/src@@handy-0.0@sha/hdy-leaflet.c.o'.
../src/hdy-leaflet.c: In function ‘hdy_leaflet_size_allocate’:
../src/hdy-leaflet.c:1488:16: warning: ‘max_child_size’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       end_size += orientation == GTK_ORIENTATION_HORIZONTAL ?
       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         (box_homogeneous ? max_child_size : child_info->nat.width) :
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         (box_homogeneous ? max_child_size : child_info->nat.height);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hdy-leaflet.c:1390:8: note: ‘max_child_size’ was declared here
   gint max_child_size;
        ^~~~~~~~~~~~~~

I think this takes care of it, it moves the initialization of max_child_state in the scope of the case statement, as opposed to the if branch

cc @adrien.plazas

Edited Aug 10, 2018 by Jordan Petridis
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: leaflet-unitialized-variable