mir icon indicating copy to clipboard operation
mir copied to clipboard

Use of reserved identifiers

Open michaelforney opened this issue 5 years ago • 3 comments

I noticed that MIR uses reserved identifiers throughout the codebase:

  • Names beginning with an underscore and capital letter are reserved for the implementation for any use (C11 7.1.3p1). MIR uses many symbols named this way (_MIR_*).
  • POSIX reserves identifiers ending in _t for use in any header (POSIX.1-2017 name space). MIR names many of its types this way (MIR_*_t).

It is possible to choose different naming schemes for the identifiers used in MIR so that they don't conflict with those reserved for ISO C and POSIX?

michaelforney avatar Feb 01 '20 02:02 michaelforney

Thank you for reporting this. I think changing _MIR prefix is not a problem. Entities with such prefix name are used rarely and only internally.

Changing MIR_*_t could be a problem. As I understand some people already using MIR code and I can not yet figure out alternative naming I like. I think the probability of conflicts with posix headers are extremely low. In any case I did not decide yet what to do MIR_*_t names.

Thank you again for pointing out the issue.

vnmakarov avatar Feb 02 '20 14:02 vnmakarov

export is also a c++ reserved keyword in struct MIR_item

ibmibmibm avatar Feb 03 '20 09:02 ibmibmibm

export is also a c++ reserved keyword in struct MIR_item

I missed this. It is serious. I renamed members export/import/forward. https://github.com/vnmakarov/mir/commit/36c1c43ee406e7eb9b5e4f4407dd48f2e6b83e06#annotation_108525331

Thank you for reporting this issue.

vnmakarov avatar Feb 03 '20 15:02 vnmakarov