Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!uw-beaver!uw-june!uw-entropy!dataio!bright From: bright@dataio.Data-IO.COM (Walter Bright) Newsgroups: comp.lang.c Subject: Re: Stack overflow with MSC V3.0 Message-ID: <1315@dataio.Data-IO.COM> Date: Wed, 10-Jun-87 13:40:32 EDT Article-I.D.: dataio.1315 Posted: Wed Jun 10 13:40:32 1987 Date-Received: Sat, 20-Jun-87 04:15:26 EDT References: <720@cod.UUCP> Reply-To: bright@dataio.UUCP (Walter Bright) Organization: Data I/O - FutureNet Corp., Redmond, WA Lines: 19 Keywords: help In article <720@cod.UUCP> murphys@cod.UUCP (Steven P. Murphy) writes: -I am having troubles with C, MSC V3.0 to be exact. -I have written a program on a pc to do some matrix operations -and I had been using LINT on a main frame to help debug it. -The problem is it compiles on the main frame with % cc filename -lm and runs, -but on the pc I use: - - msc /AL /FPi filename - - link /STACK:65000 filename -and all I get is stack overflow. Any help with what I'm doing wrong -would be greatly appreciated. First of all, without seeing your source code I can only guess. My suspicion would be that you are declaring large arrays (matrices) using the automatic (on the stack) storage class. It's easy to get excessively large automatic arrays, even a double matrix[10][10]; allocates 10*10*8 = 8000 bytes on the stack. I have run into similar problems many times when porting code from a mainframe. The solution is to use static storage class, or malloc().