dgibson / dtc

Device Tree Compiler
218 stars 130 forks source link

Fix -Wwrite-strings #82

Closed elmarco closed 1 year ago

elmarco commented 1 year ago

Those changes break API/ABI (some user char * are no longer free()), but they should also fix incorrect or unwanted free() calls.

dgibson commented 1 year ago

So, I think this kind of just papers over the problem.

The basic problem here is that sometimes the name fields in properties and nodes are allocated (so should be free()ed) and other times are static strings. I believe the original intention was that they always be allocated (so static strings should be strdup()ed before insertion), but that's a really easy constraint to miss, so we have.

I think that's what we really need to address.

elmarco commented 1 year ago

See #86