This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: External argc and argv



> I need to be able to access argc and argv within a static constructor.
> The way to do this would be to access external global declarations of
> argc and argv.  This is usually different for each platform.  For
> example, on Digital UNIX and Irix (using their native compilers) they
> provide __Argc and __Argv.
> 
> From what I can see, egcs does not provide such a thing.

egcs cannot, since the code that creates argc and argv is provided by
the OS vendor, not by egcs.

> make any suggestions for me, or know of a way of accessing argc and argv
> within a static constructor (constructs a static global object before
> even getting to main())?

There is no portable way to do the job.  You might be able to do it on
an OS-specific basis, but the code will have to be different for each
platform.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]