Skip to content
  • Florian Bezdeka's avatar
    lib/boilerplate/iniparser: Allow building with GCC 10.2 2020101 · efb12a1d
    Florian Bezdeka authored and Jan Kiszka's avatar Jan Kiszka committed
    Updating to upstream revision f858275f7f307eecba84c2f5429483f9f28007f8.
    Upstream repository is located at [1].
    
    The reason for updating was the following compiler error when trying
    to compile with GCC 10.2 10.2.1 20201016. As it turned out the problem
    was already addressed upstream:
    
    iniparser/iniparser.c: In function ‘iniparser_load’:
    iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may
    overlap destination object ‘buf’ [-Werror=restrict]
       616 |             sprintf(tmp, "%s:%s", section, key);
           |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    I reviewed especially the API changes. Most of them are cleanups only
    but two things should be pointed out:
    
      - The type of the size field of struct _dictionary_ changed from int
        to ssize_t. The only user of this struct is
        lib/analogy/calibration.c which uses this structure for internal
        things only. It is never exposed to any public API so updating is
        OK and fully backward compatible.
    
      - dictionary_new changed its signature
          from dictionary_new(int size)
          to   dictionary_new(size_t size).
        This function is not part of any public API. So updating does not
        break backward compatibility.
    
    [1] https://github.com/ndevilla/iniparser
    
    
    
    Signed-off-by: default avatarFlorian Bezdeka <florian.bezdeka@siemens.com>
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    efb12a1d