• Stephan Bergmann's avatar
    Avoid -Werror=stringop-truncation · 26688cf0
    Stephan Bergmann yazdı
    ...as emitted by at least GCC 8.2 with --enable-optimized.  These are not
    actually problems, as in both cases strncpy(p,...,N-1) is used to copy a
    string into an area p of length N that has initially been zero-initialized, so
    p[N-1] will already contain NUL.  But add the (redundant) p[N-1]=NUL just in
    case, and to silence GCC (where the documentation explicitly recommends this
    additional write as a way to silence the warning).  Unfortunately, in hstyle.cxx
    at least GCC 8.2 with --enable-optimized would still emit the warning, even
    though it uses the recommended way of handling it, so needs to be silenced with
    a #pragma.
    Change-Id: Ie41f420c732c2bfb699903ebd21ce1a89dd2b236
    Reviewed-on: https://gerrit.libreoffice.org/66620
    Tested-by: Jenkins
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
hfont.cxx 2.53 KB