svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde

Bruce Evans brde at optusnet.com.au
Tue Nov 11 11:48:47 UTC 2014


On Tue, 11 Nov 2014, [utf-8] Dag-Erling Smørgrav wrote:

> "Bjoern A. Zeeb" <bz at FreeBSD.org> writes:
>> This fails to compile on all gcc platforms.
>>
>> cc1: warnings being treated as errors
>> /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndael/rijndael-api-fst.c:
>> In function 'rijndael_padEncrypt':
>> /scratch/tmp/bz/head.svn/sys/modules/geom/geom_bde/../../../crypto/rijndael/rijndael-api-fst.c:236:
>> warning: cast discards qualifiers from pointer target type
>> [...]
>
> The code is quite clearly wrong.  Why doesn't clang complain?

-Wcast-qual is broken (has no effect) with clang.  This is incompatible
with gcc and defeats the reason of existence of -Wcast-qual.

-Wcast-qual is not a very good warning option since the official way
to remove qualifiers in C is to cast them away.  Casting them away is
better than using the __DECONST() abomination.  The option exists
because it is too easy for sloppy code to cast away const without
really intending to or when casting away const is done intentionally
but is an error.

Bruce


More information about the svn-src-all mailing list