From: "A.Appleyard" To: DJGPP AT sun DOT soe DOT clarkson DOT edu Date: Tue, 14 Nov 1995 14:37:03 GMT Subject: A funny abort in djgpp I have dj112m1.zip dj112m2.zip djdev112.zip djdoc112.zip djemu112.zip djeoe112.zip djlgr112.zip djlsr112.zip djsrc112.zip djtst112.zip fsdb091a.zip gas23bn.zip gas23dc.zip gcc260bn.zip gcc260dc.zip gcc260rm.zip gdb412bn.zip gdb412dc.zip gpp260.zip lgp260bn.zip lgp260dc.zip lgp260sr.zip txi310bn.zip txi310dc.zip unzip386.exe wmemu112.zip When I compile the program T$.CC quoted below as `gcc t$.cc -c', I get a abort "Segmentation violation in pointer 0x00000009 at d8:585a9". But if I comment out the instruction `H=new header[n];', the compilation completes. I get no djgpp fault or warning messages in either case. OK, I should have put `H=new header*[n];'. And it should have told me so, not crashed out. #define uns unsigned #define reg register #define pk __attribute__((packed)) typedef uns long ul; typedef uns short us; typedef uns char byte; class buffer{public: double x;}; class line {public: double x; line*next;}; class FCBtime{public: uns short x; void strcat(char*B);}; class FCBdate{public: uns short x; void strcat(char*B);}; class header{public: ul signature pk; byte versionreqd pk; byte opsystem pk; us gp pk; us compmethod pk; FCBtime time pk; FCBdate date pk; ul crc32 pk; ul compsize pk; ul uncompsize pk; us fnleng pk; us extraleng pk; int pr();}; class centralheader{public: ul signature pk; byte version pk; byte opsystem pk; byte versionreqd pk; byte opsystemreqd pk; us gp pk; us compmethod pk; FCBtime time pk; FCBdate date pk; ul crc32 pk; ul compsize pk; ul uncompsize pk; us fnleng pk; us extraleng pk; us fcommleng pk; us filediskno pk; us intattr pk; ul extattr pk; ul localoffset pk; int pr();}; class tailend{public: ul signature pk; us thisdiskno pk; us cendirbegdiskno pk; us nentries pk; us nfiles pk; ul cendirsize pk; ul cendiroffset pk; us commentsize pk; int pr();}; short HS=sizeof(header),CS=sizeof(centralheader),TS=sizeof(tailend); /*-----*/ class zipinfo{public: header**H; centralheader**C; tailend*T; ul**nH,**nC,*nT; void operator=(buffer*B);}; /*-----*/ void zipinfo::operator=(buffer*B){int i,n=0; line*L; while(L=L->next) n++; H=new header[n];}