Messages in this thread | | | Date | Wed, 8 Oct 2014 11:46:20 +0200 | From | Michal Kubecek <> | Subject | Re: [PATCH 1/1 net-next] af_unix: remove NULL assignment on static |
| |
On Wed, Oct 08, 2014 at 09:10:23AM +0000, David Laight wrote: > From: Hannes Frederic Sowa > > I think David's concern was whether if 0 == false in all situations. It > > is pretty clear that static memory is initialized to 0. > > I'm not 100% sure about that. > static pointers may be required to be initialised to NULL.
ISO C 99 says:
If an object that has static storage duration is not initialized explicitly, then: - if it has pointer type, it is initialized to a null pointer; - if it has arithmetic type, it is initialized to (positive or unsigned) zero; - if it is an aggregate, every member is initialized (recursively) according to these rules; - if it is a union, the first named member is initialized (recursively) according to these rules.
Michal Kubeček
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |