|
From: | Norbert Nemec |
Subject: | Re: [Texmacs-dev] CVS HEAD fails to compile |
Date: | Wed, 07 Mar 2007 08:19:54 +0100 |
User-agent: | Thunderbird 2.0b2 (X11/20070116) |
Lionel Elie Mamane wrote:
It also contains this very suspicious code in src/System/Misc/fast_alloc.cpp: void* safe_malloc (register size_t sz) { void* ptr= malloc (sz); if (ptr==NULL) { cerr << "Fatal error: out of memory\n"; cout << 1/0 << "\n"; exit (1); } return ptr; } the "cout << " line looks suspicious, probably a local debugging code that was not meant to be committed? It was introduced with commit log: Fix bug concerning surroundings of GUI elements and not e.g. "make sure we die with SIGFPE on out of memory".
I found this crude hack somewhere else in the code as well. It is supposed to be a way to kill the program with a signal which can be caught by a debugger. The proper way to do this would be:
abort(); instead of: cout << 1/0 << "\n"; exit(1);The standard-C "abort" command is the preferred way to kill the program with SIGABRT.
[Prev in Thread] | Current Thread | [Next in Thread] |