An error occurred while fetching folder content.
gcc-10: avoid shadowing standard library 'free()' in crypto
Linus Torvalds authored
commit 1a263ae6

 upstream.

gcc-10 has started warning about conflicting types for a few new
built-in functions, particularly 'free()'.

This results in warnings like:

   crypto/xts.c:325:13: warning: conflicting types for built-in function ‘free’; expected ‘void(void *)’ [-Wbuiltin-declaration-mismatch]

because the crypto layer had its local freeing functions called
'free()'.

Gcc-10 is in the wrong here, since that function is marked 'static', and
thus there is no chance of confusion with any standard library function
namespace.

But the simplest thing to do is to just use a different name here, and
avoid this gcc mis-feature.

[ Side note: gcc knowing about 'free()' is in itself not the
  mis-feature: the semantics of 'free()' are special enough that a
  compiler can validly do special things when seeing it.

  So the mis-feature here is that gcc thinks that 'free()' is some
  restricted name, and you can't shadow it as a local static function.

  Making the special 'free()' semantics be a function attribute rather
  than tied to the name would be the much better model ]
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
dca0ae39
Name Last commit Last update
..
asymmetric_keys KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails
async_tx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335
842.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
Kconfig crypto: essiv - fix AEAD capitalization and preposition use in help text
Makefile crypto: aegis128-neon - use Clang compatible cflags for ARM
ablkcipher.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
acompress.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
adiantum.c crypto: shash - remove shash_desc::flags
aead.c crypto: aead - Do not allow authsize=0 if auth. alg has digestsize>0
aegis.h crypto: aegis128 - Fix -Wunused-const-variable warning
aegis128-core.c crypto: aegis128 - Fix -Wunused-const-variable warning
aegis128-neon-inner.c crypto: arm64/aegis128 - use explicit vector load for permute vectors
aegis128-neon.c crypto: arm64/aegis128 - implement plain NEON version
aes_generic.c crypto: aes-generic - remove unused variable 'rco_tab'
aes_ti.c crypto: aes - create AES library based on the fixed time AES code
af_alg.c crypto: af_alg - Use bh_lock_sock in sk_destruct
ahash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
akcipher.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
algapi.c crypto: api - Fix race condition in crypto_spawn_alg
algboss.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
algif_aead.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
algif_hash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
algif_rng.c net: remove sock_no_poll
algif_skcipher.c crypto: algif_skcipher - Use chunksize instead of blocksize
ansi_cprng.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 42
anubis.c
api.c
arc4.c
authenc.c
authencesn.c
blkcipher.c
blowfish_common.c
blowfish_generic.c
camellia_generic.c
cast5_generic.c
cast6_generic.c
cast_common.c
cbc.c
ccm.c
cfb.c
chacha20poly1305.c
chacha_generic.c
cipher.c
cmac.c
compress.c
crc32_generic.c
crc32c_generic.c
crct10dif_common.c
crct10dif_generic.c
cryptd.c
crypto_engine.c
crypto_null.c
crypto_user_base.c
crypto_user_stat.c
ctr.c
cts.c
deflate.c
des_generic.c
dh.c
dh_helper.c
drbg.c
ecb.c
ecc.c
ecc.h
ecc_curve_defs.h
ecdh.c
ecdh_helper.c
echainiv.c
ecrdsa.c
ecrdsa_defs.h
ecrdsa_params.asn1
ecrdsa_pub_key.asn1
essiv.c
fcrypt.c
fips.c
gcm.c
gf128mul.c
ghash-generic.c
hash_info.c
hmac.c
internal.h
jitterentropy-kcapi.c
jitterentropy.c
keywrap.c
khazad.c
kpp.c
lrw.c
lz4.c
lz4hc.c
lzo-rle.c
lzo.c
md4.c
md5.c
memneq.c
michael_mic.c
nhpoly1305.c
ofb.c
pcbc.c
pcrypt.c
poly1305_generic.c