David Brown <david.brown@hesbynett.no> writes:
On 21/08/2026 21:12, Chris M. Thomasson wrote:
On 8/20/2026 4:42 PM, Richard Tobin wrote:Yes.
In article <11681np$3s8jk$4@dont-email.me>,Oh. I must have missed that one.
Lawrence D;Oliveiro-a <ldo@nz.invalid> wrote:
The spec also says that all static variables are initialized to zero >>>>> at program start time. Are pointer variables allowed to be given an
all-zero bit pattern at this time? Or are they supposed to be
initialized to the NULL value (if that's different) instead?
ISO C 1999, 6.7.8:
If an object that has automatic storage duration is not initialized
explicitly, its value is indeterminate. If an object that has static
storage duration is not initialized explicitly, then:
rCo if it has pointer type, it is initialized to a null pointer;
so:
static void* g_ptr;
is guaranteed to be nullptr? Just to clarify...
I would still recomend memset or bzero. You never know what is complient
or not - better to be safe then sorry.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 54:56:37 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,585 |