Uploaded image for project: 'Apache NiFi MiNiFi C++'
  1. Apache NiFi MiNiFi C++
  2. MINIFICPP-1571

fix nanofi warnings -Wstringop-truncation (GCC 10+)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 0.10.0
    • None

    Description

      {{In file included from /usr/include/string.h:519,
      from ../thirdparty/ut/uthash.h:29,
      from ../nanofi/include/api/ecu.h:24,
      from ../nanofi/src/api/ecu.c:1:
      In function ‘strncpy’,
      inlined from ‘get_properties.part.0’ at ../nanofi/src/api/ecu.c:407:5:
      /usr/include/bits/string_fortified.h:95:10: warning: __builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
      95 |   return _builtin_strncpy_chk (_dest, __src, __len,
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      96 |                                   _glibc_objsize (_dest));
         |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      ../nanofi/src/api/ecu.c: In function ‘get_properties.part.0’:
      ../nanofi/src/api/ecu.c:405:15: note: length computed here
      405 |     int len = strlen(file_path);
          |               ^~~~~~~~~~~~~~~~~
      In file included from /usr/include/string.h:519,
      from ../thirdparty/ut/uthash.h:29,
      from ../nanofi/include/api/ecu.h:24,
      from ../nanofi/src/api/ecu.c:1:
      In function ‘strncpy’,
      inlined from ‘on_trigger_tailfilechunk’ at ../nanofi/src/api/ecu.c:277:9:
      /usr/include/bits/string_fortified.h:95:10: warning: __builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
      95 |   return _builtin_strncpy_chk (_dest, __src, __len,
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      96 |                                   _glibc_objsize (_dest));
         |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
      ../nanofi/src/api/ecu.c: In function ‘on_trigger_tailfilechunk’:
      ../nanofi/src/api/ecu.c:275:19: note: length computed here
      275 |         int len = strlen(file_path);
          |                   ^~~~~~~~~~~~~~~~~
      }}

      Attachments

        Activity

          People

            szaszm Marton Szasz
            szaszm Marton Szasz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h