hikari wayland compositor (https://hikari.acmelabs.space)

#17Warnings reported by Clang static analyzer

$ pkg install llvm11
$ scan-build11 make -s

# Tidy can report the same
$ pkg install -g "py3?-bear"
$ bear make -s
$ /usr/local/llvm11/share/clang/run-clang-tidy.py -clang-tidy-binary clang-tidy11 -checks="-*insecureAPI*"
src/server.c:526:23: warning: Value stored to "view" during its initialization is never read [clang-analyzer-deadcode.DeadStores]
  struct hikari_view *view =
                      ^
src/server.c:526:23: note: Value stored to "view" during its initialization is never read
1 warning generated.

src/configuration.c:1385:9: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
        hikari_output_config_set_background_fit(output_config, background_fit);
        ^
src/configuration.c:1657:18: note: Calling "hikari_configuration_load"
  bool success = hikari_configuration_load(configuration, config_path);
                 ^
src/configuration.c:1577:7: note: Assuming "configuration_obj" is not equal to NULL
  if (configuration_obj == NULL) {
      ^
src/configuration.c:1577:3: note: Taking false branch
  if (configuration_obj == NULL) {
  ^
src/configuration.c:1588:7: note: Assuming "actions_obj" is equal to NULL
  if (actions_obj != NULL && !parse_actions(configuration, actions_obj)) {
      ^
src/configuration.c:1588:27: note: Left side of "&&" is false
  if (actions_obj != NULL && !parse_actions(configuration, actions_obj)) {
                          ^
src/configuration.c:1595:7: note: Assuming "layouts_obj" is equal to NULL
  if (layouts_obj != NULL && !parse_layouts(configuration, layouts_obj)) {
      ^
src/configuration.c:1595:27: note: Left side of "&&" is false
  if (layouts_obj != NULL && !parse_layouts(configuration, layouts_obj)) {
                          ^
src/configuration.c:1600:10: note: Assuming the condition is true
  while ((cur = ucl_object_iterate_safe(it, false)) != NULL) {
         ^
src/configuration.c:1600:3: note: Loop condition is true.  Entering loop body
  while ((cur = ucl_object_iterate_safe(it, false)) != NULL) {
  ^
src/configuration.c:1603:9: note: Assuming the condition is false
    if (!strcmp(key, "ui")) {
        ^
src/configuration.c:1603:5: note: Taking false branch
    if (!strcmp(key, "ui")) {
    ^
src/configuration.c:1607:16: note: Assuming the condition is false
    } else if (!strcmp(key, "views")) {
               ^
src/configuration.c:1607:12: note: Taking false branch
    } else if (!strcmp(key, "views")) {
           ^
src/configuration.c:1611:16: note: Assuming the condition is false
    } else if (!strcmp(key, "marks")) {
               ^
src/configuration.c:1611:12: note: Taking false branch
    } else if (!strcmp(key, "marks")) {
           ^
src/configuration.c:1615:16: note: Assuming the condition is false
    } else if (!strcmp(key, "bindings")) {
               ^
src/configuration.c:1615:12: note: Taking false branch
    } else if (!strcmp(key, "bindings")) {
           ^
src/configuration.c:1619:12: note: Taking true branch
    } else if (!strcmp(key, "outputs")) {
           ^
src/configuration.c:1620:12: note: Calling "parse_outputs"
      if (!parse_outputs(configuration, cur)) {
           ^
src/configuration.c:1426:10: note: Assuming the condition is true
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
         ^
src/configuration.c:1426:3: note: Loop condition is true.  Entering loop body
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
  ^
src/configuration.c:1434:10: note: Calling "parse_output_config"
    if (!parse_output_config(output_config, cur)) {
         ^
src/configuration.c:1360:10: note: Assuming the condition is true
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
         ^
src/configuration.c:1360:3: note: Loop condition is true.  Entering loop body
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
  ^
src/configuration.c:1363:5: note: Taking true branch
    if (!strcmp(key, "background")) {
    ^
src/configuration.c:1366:11: note: Assuming "type" is not equal to UCL_STRING
      if (type == UCL_STRING) {
          ^
src/configuration.c:1366:7: note: Taking false branch
      if (type == UCL_STRING) {
      ^
src/configuration.c:1376:18: note: Assuming "type" is equal to UCL_OBJECT
      } else if (type == UCL_OBJECT) {
                 ^
src/configuration.c:1376:14: note: Taking true branch
      } else if (type == UCL_OBJECT) {
             ^
src/configuration.c:1378:9: note: "background_fit" declared without an initial value
        enum hikari_background_fit background_fit;
        ^
src/configuration.c:1380:14: note: Calling "parse_background"
        if (!parse_background(cur, &background, &background_fit)) {
             ^
src/configuration.c:1303:10: note: Assuming the condition is true
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
         ^
src/configuration.c:1303:3: note: Loop condition is true.  Entering loop body
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
  ^
src/configuration.c:1305:5: note: Taking true branch
    if (!strcmp(key, "path")) {
    ^
src/configuration.c:1303:10: note: Assuming the condition is false
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
         ^
src/configuration.c:1303:3: note: Loop condition is false. Execution continues on line 1337
  while ((cur = ucl_object_iterate_safe(it, true)) != NULL) {
  ^
src/configuration.c:1337:8: note: "has_background" is true
  if (!has_background) {
       ^
src/configuration.c:1337:3: note: Taking false branch
  if (!has_background) {
  ^
src/configuration.c:1348:3: note: Returning without writing to "*fit"
  return success;
  ^
src/configuration.c:1348:3: note: Returning the value 1 (loaded from "success"), which participates in a condition later
src/configuration.c:1380:14: note: Returning from "parse_background"
        if (!parse_background(cur, &background, &background_fit)) {
             ^
src/configuration.c:1380:9: note: Taking false branch
        if (!parse_background(cur, &background, &background_fit)) {
        ^
src/configuration.c:1385:9: note: 2nd function call argument is an uninitialized value
        hikari_output_config_set_background_fit(output_config, background_fit);
        ^
1 warning generated.