[squid-dev] [PATCH] squid: let it compile ok for gcc7

Dengke Du dengke.du at windriver.com
Wed Jun 21 07:58:58 UTC 2017



On 2017年06月21日 15:00, Amos Jeffries wrote:
> 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?

Squid: 3.5.26
OS: linux 4.8
GCC: 7.1

I switch the GCC to 6.3 is OK.

>
> Cheers
> Amos
> _______________________________________________
> squid-dev mailing list
> squid-dev at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-dev



More information about the squid-dev mailing list