Re: [PATCH 7/16] Let void have sizeof 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexey Zaytsev wrote:
[...]
> So far the only concern with void* is that not everyone knows
> the it is sizeof 1. So if you propose repulsing void* with char*
> when we don't really need a void*, that's probably fine. But don't
> you think there are more useful ways to spend your time?
> With open issues like the Global Warming, World Hunger and
> standing 2.6.28 regressions, I don't see anyone bothered with
> repacing unnecessary void* casts.

The thing is, sizeof(void) is *not* 1. sizeof(void) is *illegal*. It
just happens that gcc, as a platform-specific extension, treats
sizeof(void) as 1 by default.

As a linter, sparse really ought not to be encouraging non-portable
behaviour. Admittedly, there's so much stuff in the kernel source that's
gcc-specific that it's probably not going to be possible to make it
build on anything else, but it should still warn people about it unless
specifically told otherwise --- it's bad practice, and may be indicative
of further problems elsewhere, and as such is worth a diagnostic.

- --
David Given
dg@xxxxxxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJUrCmf9E0noFvlzgRAkRCAJwPffkuAuAMxfJJSkh+H7AlIPHQkQCgtGRQ
0t71dcB7ZaIKud6Qi5XXrx8=
=83ss
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux