EG
Size: a a a
EG
EG
EG
RP
P
(void*)0
это некая null pointer constant
.int x = 0;это уже не null pointer constant, потому что не constant expression.
void* n = (void*)x;
AK
void* p = (void*)0;может положить в
p
не ноль на некоторых архитектурахEG
==767371== Memcheck, a memory error detector
==767371== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==767371== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==767371== Command: ./a.out
==767371==
mmaping zero
Mmap result:: Success
pointer = (nil)
assigning value
value = 5
==767371==
==767371== HEAP SUMMARY:
==767371== in use at exit: 0 bytes in 0 blocks
==767371== total heap usage: 3 allocs, 3 frees, 2,520 bytes allocated
==767371==
==767371== All heap blocks were freed -- no leaks are possible
==767371==
==767371== For lists of detected and suppressed errors, rerun with: -s
==767371== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
EG
RP
Т8
EG
RP
AL
RP
RP
EG
mmap()
— ни разу не константное выражение.Т8
p
P
EG