I've found myself wanting to attach clib (or, failing that, passL) pragmas to {.importc.} procs, and have them work in much the same way that the header pragma works: if the proc is used, then the flags are added to the link command line, but otherwise they are not. From what I can tell, right now, the {.passL.} pragma only works at file/module scope, and there is no pragma at all corresponding to --clib.
Am I missing a way to do this? If not, is this a reasonable enhancement to propose?
Am I missing a way to do this?
No, it doesn't exist.
If not, is this a reasonable enhancement to propose?
I guess so, but I'm not so sure I like the idea.