# New Ticket Created by  Leopold Toetsch 
# Please include the string:  [perl #35391]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=35391 >


During changes related to #34994 I did introduce 3 const cast warnings, 
which are just symptoms of a deeper problem (besides that I'm never 
sure, what should be const and what not;).

We have e.g:

opcode load_bytecode (in STR)

   STRING $1   => char *file

...
Parrot_locate_runtime_file( ... char *file_name)

   STRING *runtime_prefix  => char *prefix
   concat(prefix, file_name) which needs malloc
   char *full_name         =>  STRING *str

Parrot_stat_info_intval( ... STRING *file)

         => char *filename    stat(2)

Well, doesn't look really like an overview, but we have several 
string_to_cstring() and string_from_cstring() calls plus 
mem_sys_allocate and strcat.

It was already discussed some time ago that we should have some 
interface functions for this, which would also get rid of the mess 
above. See also "The Perl 6 Summary for the week ending 20030907"
or google for "Path::Class parrot".

As a starter an equivalent of File::Spec::catfile() would suffice to be 
able to rewrite above code.

Comments and proposals welcome,
leo

Reply via email to