Skip to content

name collisions between pclu code and underlying C library #1

Description

@kuszmaul

For example: If a user defines a procedure named foo, then the pclu compiler generates a C function named foo. That can cause trouble if foo is needed by the pclu runtime.

Anecdotally: Apparently someone wrote a procedure named 'printf` and their program wouldn't work.

One solution is to instead generate a function named Clu_foo, and require that the runtime system define or link any functions that start with foo_. (Note there are symbols in the runtime such as clu_alloc , _pclu_erstr, and pclu_unhandled and CLU_add_parm_info_const. So if we want to use clu_ as a prefix we need to get rid of those, or find a different prefix. It apperas that Clu (note capitilzation) is otherwise unused.

There is currently code to rename symbols that would conflict with C keywords, so that for example the purify procedure renames long to long_UNIQ. I don't think that's needed if we just rename it to Clu_long. I also don't understand why it adds the newly reserved name into reserved.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions