OS_GetEnv result

Peter Naulls peter at chocky.org
Fri Aug 2 03:14:16 PDT 2002


In message <3D4A5A57.7040109 at barco.com> John Tytgat wrote:

> Peter Naulls wrote:
> 
> >In message <3D4A53BC.5080409 at esko-graphics.com>
> >          John Tytgat <JoTy at esko-graphics.com> wrote:
> >
> >>BTW, another problem with argv[0] is when you've configured UnixLib to
> >>get Unix alike file specs, argv[0] is still a RISC OS file spec.
> >>
> >
> >This is the related issue of course.  A weak symbol may be in order
> >here.
> >
> I'm not sure whether I fully understand the purpose of this weak symbol 
> here.

Something like the setting for a program's DA heap.  If the symbol is
created your the program, then unixlib uses a RO pathname, if not (the
symbol's address is 0), then we unix behaviour on argv[0].

> >  However, given that the Unixlib default is to use unix filenames,
> >probably argv[0] should have unix semtantics.  As you're no doubt aware,
> >it's quite common for programs to pick up argv[0], and truncate it to a
> >'/' for use with message reporting.
> >
> Indeed.
> 
> We better to followup this discussion in the GCC mailing list.

Peter

-- 
------------------------------------------------------------------------
 Peter Naulls - peter at chocky.org
 Homepage                     -  http://www.chocky.org/
 RISC OS C Programming        -  http://www.riscos.info/
 Unix Programs on RISC OS     -  http://www.chocky.org/unix/
------------------------------------------------------------------------



More information about the gcc mailing list