Ticket #152 (closed RFC: done)

Opened 6 years ago

Last modified 3 years ago

Do we need PARROT_CATCH_NULL?

Reported by: coke Owned by: whiteknight
Priority: minor Milestone:
Component: core Version:
Severity: medium Keywords:
Cc: petdance Language:
Patch status: Platform:

Description

svn blame of PARROT_CATCH_NULL's definition says:

 13169       chip /* TODO - Make this a config option */
  4643        leo #define PARROT_CATCH_NULL 1

This behavior is pretty entrenched. Do we still want this to be configurable, or can delete the other option?

Change History

  Changed 5 years ago by jkeenan

  • component changed from none to core

  Changed 4 years ago by whiteknight

  • owner set to whiteknight

follow-up: ↓ 4   Changed 4 years ago by cotto

I don't see any value in making this a configure-time option. It may be needed for splint, but if not it'd be easiest just to rip it out wholesale.

in reply to: ↑ 3   Changed 3 years ago by jkeenan

Replying to cotto:

I don't see any value in making this a configure-time option. It may be needed for splint, but if not it'd be easiest just to rip it out wholesale.

Here are the current locations for PARROT_CATCH_NULL in our source code:

$ ack -A2 PARROT_CATCH_NULL *
include/parrot/interpreter.h
296:#ifndef PARROT_CATCH_NULL
297-#  ifdef S_SPLINT_S
298:#    define PARROT_CATCH_NULL 0
299-#  else
300:#    define PARROT_CATCH_NULL 1
301-#  endif
302-#endif
--
305:#if PARROT_CATCH_NULL
306-PARROT_DATA PMC    *PMCNULL;    /* Holds single Null PMC */
307-PARROT_DATA STRING *STRINGNULL; /* a single Null STRING */
--
315:#endif /* PARROT_CATCH_NULL */
316-
317-#define STRING_IS_EMPTY(s) ((s)->strlen == 0)

src/interp/inter_create.c
140:#if PARROT_CATCH_NULL
141-        PMCNULL                    = NULL;
142-#endif

src/pmc.c
67:#if PARROT_CATCH_NULL
68-PMC * PMCNULL;
69-#endif
--
90:#if PARROT_CATCH_NULL
91-    return pmc == PMCNULL || pmc == NULL;
92-#else

src/string/api.c
32:#if PARROT_CATCH_NULL
33-STRING *STRINGNULL;
34-#endif
--
159:#if PARROT_CATCH_NULL
160-    /* initialize STRINGNULL, but not in the constant table */
161-    STRINGNULL = Parrot_str_new_init(interp, NULL, 0,

Can someone evaluate the implications of ripping it out? Will it require deprecation cycle?

Thank you very much.

kid51

  Changed 3 years ago by bacek

  • cc petdance added

Hello.

I would like to drop PARROT_CATCH_NULL in favor of unconditionally defined PMCNULL as Null PMC. As far as I understand only Splint uses "bare NULLs". If Andy has no objections let's do it.

-- Vasily

  Changed 3 years ago by benabik

  • status changed from new to closed
  • resolution set to done

Ack gives no results for PARROT_CATCH_NULL in master.

Looks like it was removed on 4/13/2001 in 4cbdf8dc0b39d2f6f35342633de42cc5a81b989b by petdance.

Note: See TracTickets for help on using tickets.