svn commit: r351364 - in head/sys: crypto/blowfish crypto/chacha20 crypto/des opencrypto

Bjoern A. Zeeb bz at FreeBSD.org
Fri Aug 23 16:59:42 UTC 2019


On 23 Aug 2019, at 16:48, Warner Losh wrote:

> On Fri, Aug 23, 2019 at 10:10 AM Bjoern A. Zeeb <bz at freebsd.org> 
> wrote:
>
>> On 23 Aug 2019, at 15:53, Warner Losh wrote:
>>
>>> Sorry for top posting...
>>>
>>> I had planned this for next week, but I think give this insanity of
>>> this
>>> patch, we  should do it now: turn off -Werror for gcc 4.2.1
>>>
>>> https://reviews.freebsd.org/D21378
>>>
>>> has the review. There's no benefit to these head-scratcher changes
>>> when we
>>> can get the same benefit by ignoring gcc 4.2.1 errors as discussed 
>>> on
>>> arch at .
>>
>> That brings me to a different question: why does this build
>> https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/lastBuild/ not fail
>> despite rendering the warnings
>>
>
> There's a lot of -Wno-error and -Wno-error=XXX sprinkled in our build 
> for
> gcc 4.2.1 today, so we see the warnings but aren't stopped by them. My
> changes take a big hammer and add a global -Wno-error to CFLAGS last 
> to
> make this the behavior on gcc 4.2.1 platforms.


Yes, but that didn’t answer my questions.  It doesn’t help to try to 
avoid undefined C behaviour.

That jenkins build seems to use the toolchain from ports and with that 
gcc 6.4.0.

We see the same warning but it didn’t error as it seems to have done 
for other architectures with the in-tree gcc with the same warnings:

In file included from /workspace/src/sys/opencrypto/xform.c:94:0:
/workspace/src/sys/opencrypto/xform_des1.c: In function 'des1_setkey':
/workspace/src/sys/opencrypto/xform_des1.c:102:15: warning: cast 
discards 'const' qualifier from pointer target type [-Wcast-qual]
    des_set_key((const des_cblock *) key, p[0]);
                ^
In file included from /workspace/src/sys/opencrypto/xform.c:95:0:
/workspace/src/sys/opencrypto/xform_des3.c: In function 'des3_setkey':
/workspace/src/sys/opencrypto/xform_des3.c:103:15: warning: cast 
discards 'const' qualifier from pointer target type [-Wcast-qual]
    des_set_key((const des_cblock *)(key +  0), p[0]);
                ^
/workspace/src/sys/opencrypto/xform_des3.c:104:15: warning: cast 
discards 'const' qualifier from pointer target type [-Wcast-qual]
    des_set_key((const des_cblock *)(key +  8), p[1]);
                ^
/workspace/src/sys/opencrypto/xform_des3.c:105:15: warning: cast 
discards 'const' qualifier from pointer target type [-Wcast-qual]
    des_set_key((const des_cblock *)(key + 16), p[2]);
                ^
--



To me this means that we treat different versions of compilers (in-tree 
and out-of-tree, gcc vs. clang) too different.

If two versions of gcc (before your commit) gave the same warning I 
would have expected them to equally fail and not one fail and one pass?

My question was:  why was that the case?

/bz


More information about the svn-src-all mailing list