[net.micro.pc] Microsoft C V3.0 -> 4.0 Incompatibility

cramer@kontron.UUCP (Clayton Cramer) (10/07/86)

I recently recompiled a program under Microsoft C V4.0 and found the
program worked a little differently.  Under V3.0, a command line
argument of the form:

	/"This is a test string"
        
generated arguments like:

	Argv[1] = /"This
        Argv[2] = is
        Argv[3] = a
        Argv[4] = test
        Argv[5] = string"
        
This was not quite what I expected -- the manual indicated (at least
as I understood it) that I should get:

	Argv[1] = /This is a test string
        
But I worked around the apparent bug in V3.0.

Under V4.0, my program didn't worked the same.  My first suspicion
was that Microsoft actually fixed the bug.  What I get now, though, is

	Argv[1] = /This
        Argv[2] = is
        Argv[3] = a
        Argv[4] = test
        Argv[5] = string

which isn't right either, and caused my program some problems when
it tried to find the closing double quote.  I changed my program to
expect single quotes, and these are passed through without alteration.

Clayton E. Cramer

billp@suneast.uucp (8870x138) (10/13/86)

One other major difference is the rename library call.  The arguments are
reversed from V3.0 to V4.0:

OLD FORM( V3.0)		rename (newname, oldname)

NEW FORM( V4.0)		rename (oldname, newname)

Also the compiler will give warning messages if you have #endif statements
which is followed by some text:

#ifdef foo


#endif	foo

The old compiler would accept this.


___________________________________________________________________

Disclaimers on file.



Bill Pittore
Sun Microsystems  1 Cranberry Hill, Lexington, MA 02173

{decwrl || ihnp4 || seismo || !sun!suneast!pizza!billp}

jmsellens@watdragon.UUCP (John M Sellens) (10/15/86)

Of course, you could always look in the manual for the list of
differences (yes - it is there).

guido@mcvax.uucp (Guido van Rossum) (11/01/86)

In article <3@suneast.uucp> billp@suneast.uucp (8870x138) writes:
>One other major difference is the rename library call.  The arguments are
>reversed from V3.0 to V4.0:

And so it should be.  "Rename" is in the proposed ANSI C library, and
also a BSD system call; MSC 3.0 had the arguments reversed with respect
to these, probably because they didn't look carefully at their examples
(in general, I am very pleased with their Unix compatibility -- it makes
porting software painless).

>Also the compiler will give warning messages if you have #endif statements
>which is followed by some text.

While I don't like this change as much as the previous one, this, too,
is compatible with ANSI C (but not with common practice on Unix -- I
believe there was a battle over this in the ANSI C committee which was
lost by the Unix peoples).  At least it is a warning, not an error, so
you can take your time fixing this.
-- 
	Guido van Rossum, CWI, Amsterdam <guido@mcvax.UUCP>