[Top] [All Lists]

Re: [Nmh-workers] GCC 8 pre-releases have escaped...

2018-02-04 13:49:40
nmh builds mostly OK under it, and passes 'make check'.  However,
there's a whole mess of new warnings, which all root-cause to the
fact that gcc8 apparently does sanity checking on whether the code
has bounds-checked the length parameter of snprintf() and friends
before using it, and special-case notification when it's obvious that
the destination won't get null-terminated.

I'm ... a little confused.  Is the "right" way to deal with that by

        adr[sizeof(adr) - 1] = '\0';

        strncpy(adr, ap->text, sizeof(adr) - 1);

Or something else?  A quick Google suggests most people "fix" this by
adding -Wno-stringop-truncation to the build options.



<Prev in Thread] Current Thread [Next in Thread>