[squid-dev] [PATCH] squid: let it compile ok for gcc7
Amos Jeffries
squid3 at treenet.co.nz
Wed Jun 21 07:00:33 UTC 2017
On 21/06/17 14:54, Dengke Du wrote:
> After the gcc upgrade to gcc7.1, gcc7 contains a number of enhancements that
> help detect buffer overflow and other forms of invalid memory accesses. We
> can check the changes here:
>
> https://gcc.gnu.org/gcc-7/changes.html
>
> When gcc7 compiling squid, it outputs error:
>
> error: '%s' directive output may be truncated writing up to 8191 bytes
> into a region of size 8188 [-Werror=format-truncation=]
>
> This is because the gcc7 detect the program may have buffer overflow, so it
> outputs warning, in the squid's Makefile, the Makefile treat the warning as
> error by setting: -Werror, in order to compile it successfully, we should
> not treat the warning as error.
We prefer to fix problems first, and only hide if there is no other
solution.
Squid was building fine for me with GCC-7 a few releases ago in 4.0.19
and some of that made it into 3.5.26. What Squid release are you trying
to build and on what OS?
Cheers
Amos
More information about the squid-dev
mailing list