On Aug 15, 2007, at 10:06:49, Jan Engelhardt wrote:Well, what I was referring to is: static struct foo *some_ptr; /* Assumes that $SOME_LOCK is held */ int initialize_foo_module() { if (!some_ptr) { some_ptr = kmalloc(sizeof(*some_ptr)); if (!some_ptr) return -ENOMEM; /* ... */ } /* ... */ } We initialize all of the static data to all-bits-clear zeros during kernel init. Any platform on which the binary representations of "(unsigned long)0" and "(void *)0" are different (even in length, due to other issues) will not run the Linux kernel as it stands today. And as to the sizeof(unsigned long) == sizeof(void *) issue, please remember that every Linux compiler is either ILP32 (int, long, and pointer are 32-bit) or LP64 (int is 32-bit and long/pointer are 64- bit). We sort of fundamentally rely on these properties in code all over the place. So yes the Linux kernel "breaks the standard" in a bunch of places, but on the other hand we're not your average software and we don't have to worry about building on an LLP64 compiler (Windows 64-bit and some UNIXes) or other strangeness. Cheers, Kyle Moffett -
| Jeremy Fitzhardinge | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Michael Grollman | Re: 8169 Intermittent ifup Failure Issue With RTL8102E Chipset in Intel's New D945... |
