Ticket #676 (new cage)

Opened 6 years ago

Last modified 4 years ago

Fix namespace pollution

Reported by: Infinoid Owned by: whiteknight
Priority: minor Milestone:
Component: core Version: master
Severity: medium Keywords: api
Cc: jkeenan Language:
Patch status: Platform: all

Description

This is the trac equivalent of RTs #40059 and #40060.

There are many global symbols we're exporting which don't have a "Parrot_" prefix. This list might vary a bit depending on OS and platform, but I'll attach my current list. By my count, there are currently 182 functions and 1 variable (PMCNULL) exported by default.

I think the idea is that these functions should be renamed from "funcname" to "Parrot_funcname", and some #defines should be left behind (inside an #ifdef PARROT_IN_CORE) so we don't need to fix up all the callers (and therefore, don't need a deprecation cycle).

I think it would be a good idea to make headerizer do this for us.

Attachments

exported-symbols-without-Parrot_-prefix.txt Download (3.4 KB) - added by Infinoid 6 years ago.
Namespace pollution list

Change History

Changed 6 years ago by Infinoid

Namespace pollution list

in reply to: ↑ description   Changed 6 years ago by bacek

Replying to Infinoid:

I think the idea is that these functions should be renamed from "funcname" to "Parrot_funcname", and some #defines should be left behind (inside an #ifdef PARROT_IN_CORE) so we don't need to fix up all the callers (and therefore, don't need a deprecation cycle).

They already deprecated. From DEPRECATED.pod:

=item C API coding standards cleanup [eligible in 1.1]

All C API functions that aren't currently named according to the 'Parrot_<system>_*' scheme will be renamed. If you depend on these functions in an extending/embedding interface or C-level custom PMCs, check in 1.4 or 2.0 for the new names. -- Bacek

  Changed 6 years ago by whiteknight

I see a good number of items in that list that likely should not be exported at all because they don't have any real utility outside core. For many other functions renaming them would be pretty trivial.

We have to add deprecation notices to remove items from the list of exported functions, correct? We should maybe get such a list together before the release on tuesday.

  Changed 4 years ago by jkeenan

  • cc jkeenan added
  • component changed from none to core

whiteknight:

Does this TT fall under the API team's jurisdiction?

Thanks.

kid51

  Changed 4 years ago by whiteknight

  • priority changed from normal to minor
  • platform set to all
  • version changed from 1.1.0 to master
  • keywords api added
  • owner set to whiteknight
  • type changed from todo to cage
Note: See TracTickets for help on using tickets.