labels, outelf: remove casts for allocations
commit3e555483b30c6f0bd4b348861f694f73e487c134
authorH. Peter Anvin <hpa@zytor.com>
Mon, 24 Apr 2017 00:02:46 +0000 (23 17:02 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 24 Apr 2017 00:02:46 +0000 (23 17:02 -0700)
treeed41b485387185e2bb0f992ff1599b419bc31f78
parent4dfbd9aec56577d7e0dc9398781ea9918dbdcbf6
labels, outelf: remove casts for allocations

Remove casts from allocations.  This is simply Not How To Do Things:
every cast carries a potential risk of being a toxic type misuse
(e.g. pointer as integer) and so any unnecessary cast is actively
harmful.

Note that a lot of allocations here are completely unnecessary: the
core code now guarantees that all filenames are permanently allocated
for the duration of the assembly, and so should be turned into const
char * without any further allocation.  Any remaining malloc+strcpy
should be turned into nasm_strdup(), and nasm_new[n]() used whereever
possible.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
asm/labels.c
output/outelf.c