xelerance/Openswan

Cannot compile using GCC 9.1.0

ClaymorePT opened this issue · 2 comments

Cannot compile branch 2.6.52 using gcc 9.1.0

I'm getting this compilation error

CC tncfg.c
In file included from /usr/include/string.h:494,
                 from /home/cmf/Desktop/pkgbuild/src/openswan-git/programs/tncfg/tncfg.c:19:
In function ‘strncpy’,
    inlined from ‘main’ at /home/cmf/Desktop/pkgbuild/src/openswan-git/programs/tncfg/tncfg.c:233:4:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncpy’,
    inlined from ‘main’ at /home/cmf/Desktop/pkgbuild/src/openswan-git/programs/tncfg/tncfg.c:236:4:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 12 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Please advise.

I have suppressed the error by making just a warning, by passing -Wno-stringop-truncation to GCC.