🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #344

MS-C/C++ 7.00 bugs

#344
From: Christian Franke
Date: Mon, 10 Aug 1992 10:00
186 lines
4923 bytes
Hello,

here some new and old MS-C/C++ 7.00 bugs and disappointments:


1.) The MOVE Overlay manager does not work correctly if the
file is packed. The PWB "DOS Overlaid EXE" project template
specifies the /EXEPACK option. Turn it *off* after selecting
the template.


2.) The LINK 5.30 .DEF command

	FUNCTIONS:<Segmentname> <functions>

does not work. It is sometimes simply ignored or the linker produces
a privilege violation error.

The command

	FUNCTIONS:<Overlaynumber> <functions>

does work correctly. But you cannot put "static" functions into an
overlay with this command.


3.) The "remove unreferenced functions" feature (/Gy, /PACKF) is not
as useful as expected:

It works only on the "top level" unreferenced function. If an
unreferenced function f() calls another function g() which
is not called from elsewhere, the function g() is *not* removed.


4.) The documentation states, that the /Gy option is implied on
C++ Member functions. This is *not* true.



========================================================================
Now some bugs which were present in MS-C 6.00 also:


5.) The code below returns the following message

test.c(28) : warning C4713: error: INTERNAL COMPILER ERROR; restarting
		(compiler file '@(#)reg86.c:1.26', line 1104)
		Contact Microsoft Product Support Services

when compiled with "-Ml -Oe" or "-Mc -Oe"
The problem can be fixed by declaring "iobuf" and "bp" as "near" or "far".

----- cut ------
static char lmask[9],rmask[9];
static char iobuf[10];
static int bitnumber;

void error(code)
int code;
{
    char * bp;
    int r_off;
	bp = iobuf + (bitnumber >> 3); r_off = (bitnumber & 0x7);
	*bp = (char)((code << r_off & lmask[r_off]) | (*bp & rmask[r_off]));
	bp++;
	*bp = (char)code;
}
----- cut ------


6.) When generating an assembly (/Fa) or code (/Fc) output,
variables of simple types which are "static" and "const" are not
allocated. The MASM reports an error when assembling such files.


----- cut ------
static char const f[100];	/* OK */
static char const x;		/* Not allocated */
static char a,b,c;		/* OK */
static char const g[1]; 	/* OK */

char f()
{
	return(x);	/* MASM reports error */
}
----- cut ------


7.) The following old article produces one of the famous
MS-C 6.00 "loop optimizer" bugs, which can be reproduced
(but with different output) with 7.00:

	cl -Ox		      => Erroneous Output
	cl -f -Ox	      => OK
	cl -O<no 'l' and 'z'> => OK


>From: kdb@chinet.chi.il.us (Karl Botts)
>Newsgroups: comp.os.msdos.programmer
>Subject: MSC 6.0
>Date: 6 Nov 90 02:13:42 GMT
>Organization: Chinet - Public Access UNIX
>
>If you wanna see some aggressive optimization, compile this with MSC 6.0
>using -Od, then with -Ox, execute 'em, and compare the results (L model;
>I haven't tried the others).
>
>--------------------------- cut ---------------------
>*/
>/* kdb$hpb 19:41:01 11/05/90 */
>
>#include <stdio.h>
>#include <stdlib.h>
>
>typedef unsigned short word;
>
>#define loword(d) (*((word *)&(d)))
>#define hiword(d)	 (*(((word *)&(d)+1)))
>
>#define HASHPAGE(pg, fd)	 (loword(pg) ^ hiword(pg) ^ fd * 5821)
>
>#ifndef NUM_CHAINS
>#define NUM_CHAINS 32
>#endif
>
>long lrand()
>{
>	 long l;
>
>	 loword(l) = rand();
>	 hiword(l) = rand();
>	 return(l);
>}
>
>
>
>main()
>{
>	 int fd;
>	 long l;
>	 long chains[NUM_CHAINS];
>
>	 for ( fd = 0; fd < _NFILE; fd++ ) {
>		 word hash;
>		 memset(chains, 0, sizeof(chains));
>		 for ( l = 0; l < 100000; l++ ) {
>			 long x = lrand();
>			 hash = HASHPAGE(x, fd);
>			 hash %= NUM_CHAINS;
>			 chains[hash]++;
>		 }
>		 for ( hash = 0; hash < NUM_CHAINS; hash++ )
>			 printf("%ld%c", chains[hash], (hash + 1) % 16 ? ' ' : '\n');
>		 printf("\n");
>	 }
>
>	 return 0;
>}
>

To be continued ...

Some years ago, I sent a bug list (MS-C 5.10) to Microsoft Germany.
I never got any answer/"thank you" or whatever after sending it
three times via mail and fax.

Should I switch to Borland after using MS-C since Version 4.00?

Perhaps someone at Microsoft hears me?


Regards,

	Christian Franke

	Informatik I
	Aachen University of Technology
	Ahornstr. 55
	W-5100 Aachen
	Tel.: +49.241.80-21111
	E-Mail: franke@informatik.rwth-aachen.de

	+---------------------+
	+ This space for rent +
	+---------------------+
Technical Details
Message-ID: <franke.713440857@andrej>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!darwin.sura.net!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!andrej!franke

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!darwin.sura.net!Sirius.dfn.de!Urmel.Informatik.RWTH-Aachen.DE!andrej!franke
From: franke@andrej.informatik.rwth-aachen.de (Christian Franke)
Subject: MS-C/C++ 7.00 bugs
Message-ID: <franke.713440857@andrej>
Keywords: Microsoft, C, C++
Sender: news@Urmel.Informatik.RWTH-Aachen.DE (Newsfiles Owner)
Nntp-Posting-Host: andrej
Organization: Rechnerbetrieb Informatik  /  RWTH Aachen
Date: 10 Aug 92 10:00:57 GMT
Lines: 186