Re: Two questions about main's arguments



Denis McMahon <denis.m.f.mcmahon@xxxxxxxxxxxxxxxx> wrote:

On 09/06/10 23:57, Seebs wrote:

This question depends a whole lot on the compiler you're using.

I think it's got nothing to do with the compiler, and everything to do
with how the cli or gui concerned prepares the parameters it invoking
main with.

Surprisingly (well, it surprised me), this is indeed the case. Under old
command.coms (it's obviously a M$ CLI the OP is using), the CLI did no
argument massaging at all. Various implementations would do (or not do,
or only do if you linked certain non-Standard libs) different kinds of
argument processing.
Under Windows (at least under XP, which is what I tested it under), both
cmd.exe and command.com do _some_ argument processing, including the
behaviour the OP noted. Still no globbing, though. A quick test compiled
with two different Windows implementations and one M$-DOS one shows that
one of the former does globbing of its own, but neither CLI does.

The most surprising thing about this, IMO, is that even command.com has
been changed from its old behaviour. I'd have expected cmd.exe to have
the new behaviour, and command.com to have kept the old.

Of course, as has already been noted, according to the Standard this is
all perfectly OK. In fact, it serves as a good example of why the
Standard couldn't reasonably specify argument processing any more
precisely: if even CLIs from the same vendor, and implementations
running under the same OS, can vary like this, how can you mandate any
specific behaviour?

Richard
.



Relevant Pages

  • Re: A simple rs232 CLI
    ... I have a microblaze license but I've just taken a look at it and ... and nothing seems quite finished enough (and few with a C compiler). ... Chipscope's VIO block - it's not CLI, but I gather it has some tcl ... plenty fast enough for a CLI (I had to google CLI to figure out what ...
    (comp.arch.fpga)
  • Re: Who owns C#?
    ... as a new post despite the fact that I read and replied yesterday? ... The .NET framework is just one implementation of the CLI spec. ... could write a C# compiler which compiled to native code instead of IL - ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Graphic GUI C
    ... The CLI is a collective term for a number of components. ... CLR interpets instructions written in CIL. ... like the java compiler that give its micro instructions for java machine ... The .Net libraries ...
    (comp.lang.c)
  • Re: Who owns C#?
    ... The .NET framework is just one implementation of the CLI spec. ... Mono ... could write a C# compiler which compiled to native code instead of IL - ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Native Delphi
    ... way you don't have the overhead of JIT compilation of IL code to native ... AOT compiler does only marginally better than the JIT ... pointerless CLI code into optimal pointer using native code. ... Now, .NET CLI is much better designed than Java CLI, so allows ...
    (borland.public.delphi.non-technical)