On Sat, Nov 7, 2015 at 5:39 PM, grischka <[email protected]> wrote:

> Edmund Grimley Evans wrote:
>
>> Last night I pushed a few commits to fix bugs uncovered by ASan and
>> Valgrind. Comments and criticisms are welcome.
>>
>
> - tccgen.c: Fix memory leak involving asm_label.
> It would be better to record the asm_label as its (int) token numher.
>
>
> - cstr.data = 0; (and others)
> Use NULL.  (This is not C++)
>

According to my understanding (and to StackOverflow), a constant of 0 _is_
a NULL pointer, but NULL is not always 0 (its bit pattern may differ).

http://stackoverflow.com/questions/9894013/is-null-always-zero-in-c

FWIW, sqlite3 (which is C89-compatible except for its use of (long long))
uses 0 exclusively (or almost so) instead of NULL.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to