nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ken Hornstein
Subject: Re: [Nmh-workers] GCC 8 pre-releases have escaped...
Date: Sun, 04 Feb 2018 14:49:15 -0500

>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
doing:

        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.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]