Path: utzoo!utgpu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: Yet Another Turbo C Question Message-ID: <260EBAE3.17663@maccs.dcss.mcmaster.ca> Date: 27 Mar 90 00:59:14 GMT References: <42900071@uicsrd.csrd.uiuc.edu> <42900072@uicsrd.csrd.uiuc.edu> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 26 In article <42900072@uicsrd.csrd.uiuc.edu> dkchen@uicsrd.csrd.uiuc.edu writes: $ Thanks to those who responded and e-mailed. I solved the problem by $ using larger memory model. But I wish Turbo C can at least generate $ a warning showing that there is not enough memory around. This is a run-time problem, not a compile-time one. It's fine and dandy to have your compiler spitting out error messages and warnings, since they help you to improve your program. But I sure don't want the run-time package doing this! It's far better for your program to be able to handle such errors than to have these strange little messages appearing on a user's screen. It's a very easy task to detect whetehrg a malloc () call failed or not; simply replace foo = (bar *) malloc (sizeof (bar)); with if ((foo = (bar *) malloc (sizeof (bar))) == NULL) { /* error handling code */ } -- More half-baked ideas from the oven of: **************************************************************************** Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate ... for now!\n";