Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3695

Fix compiler complaints 'unused variable' used in assertion

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cf-agent
    • Labels:

      Description

      Fix compiler complaints 'unused variable'. The variables are used in asserts, thus the compiler complains when compiling in non-debug mode.

       

      simulate_mode.c: In function ‘ManifestStatInfo’:
      simulate_mode.c:136:12: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
        136 |     size_t ret = strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %z",
            |            ^~~
      
      
      mod_custom.c: In function ‘PromiseModule_SendMessage’:
      mod_custom.c:365:22: warning: unused variable ‘line_length’ [-Wunused-variable]
        365 |         const size_t line_length = strlen(line);
            |                      ^~~~~~~~~~~
      
      unix_iface.c: In function ‘FindV6InterfacesInfo’:
      unix_iface.c:716:30: warning: unused variable ‘dst_length’ [-Wunused-variable]
        716 |                 const size_t dst_length = src_length - 1;
            |                              ^~~~~~~~~

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            larsewi Lars Erik Wik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: