Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-4189

mender client: mdb.c warnings when compiling with gcc 10

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Days in progress:
      0

      Description

      After upgrading my OS to Ubuntu 20.10, which comes with gcc 10, mender build shows some warnings at mdb.c. See output below.

      [lluis@gerty mender](master)$ gcc --version
      gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0
      Copyright (C) 2020 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      [lluis@gerty mender](master)$ make
      go build -ldflags "-X github.com/mendersoftware/mender/conf.Version=2e5d1f0"  
      # github.com/bmatsuo/lmdb-go/lmdb
      In file included from /usr/include/string.h:519,
                       from mdb.c:97:
      In function ‘memcpy’,
          inlined from ‘mdb_env_cwalk’ at mdb.c:8968:7:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: writing 8 bytes into a region of size 1 [-Wstringop-overflow=]
         34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      mdb.c: In function ‘mdb_env_cwalk’:
      mdb.c:878:8: note: at offset 0 to object ‘mn_data’ with size 1 declared here
        878 |  char  mn_data[1];   /**< key and data are appended here */
            |        ^~~~~~~
      In file included from /usr/include/string.h:519,
                       from mdb.c:97:
      In function ‘memcpy’,
          inlined from ‘mdb_node_add’ at mdb.c:7128:4:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: writing 8 bytes into a region of size 1 [-Wstringop-overflow=]
         34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘memcpy’,
          inlined from ‘mdb_node_add’ at mdb.c:7122:5:
      /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: writing 8 bytes into a region of size 1 [-Wstringop-overflow=]
         34 |   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lluis Lluís Campos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support