Mail Archives: djgpp/1996/01/25/13:06:07
Richard W. Kelnhofer wrote
I created a class in c++ to implement interval numbers and vectors
of interval numbers. The vector class uses new and delete in
the constructors and destructors to allocate and deallocate memory
from the free store. This works well on most platforms. However,
I was getting segmentation violations when running code compiled
with djgpp on a PC. I solved the problem by placing the implementation
code for the constuctors and destructors inside the class definitions.
I was curious if this is normal or if anyone has had similar experiences?
Well, I almost never put code inline in the class definition. So I
often use new/delete in the constructor, and I never ran into problems
(yet).
So, what version of DJGPP did you use? What was the gcc version? What
was the actual code?
I used gcc 2.6.0 (on OS/2), 2.6.0 and 2.6.3 (DJGPP on DOS) and 2.7.0
on Linux, and no problems of this kind...
--
Juergen A. Erhard
eMail: jae AT laden DOT ilk DOT de
snailMail: Juergen Erhard
Belfortstr. 6
76133 Karlsruhe
GERMANY
phone: (+49) (0)721/27326
- Raw text -