From: "Andrew Crabtree" Newsgroups: comp.os.msdos.djgpp Subject: Re: Perculiar bug fix? Date: 12 Aug 1997 00:14:53 GMT Organization: Hewlett-Packard Lines: 22 Message-ID: <01bca6b4$ae002360$45111d0f@p1675cra.rose.hp.com> References: <33EEE76F DOT 2F4B904 AT NO_SPAMccds DOT cc DOT monash DOT edu> NNTP-Posting-Host: p1675cra.rose.hp.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > the exact same code, compiled under Borland TC++ V3.0? Is this normal? > Is there something i;m doing wrong (most certainly!). Were you accessing data via structure pointers?? If so note that djgpp tends to pad data more than some of the older dos compilers, and the default size of 'int' is 32 bits, not 16. You could try using __attribute__ ((packed)) to get rid of the padding, and replace ints with shorts as needed. See the docs on gcc extensions for packing data. It may also be in the FAQ. > I still also have the problem that i cannot debug any of my code that i > have '#include' into modules? Do i have to link all my source files, > instead of just all my modules? Putting code in header files is generally a poor idea. I suspsect you have run into one of the limitations of sdb debugging format. The easist way to do what you want (shameless plug following) is to get pgcc from www.goof.com. Its fairly stable right now, with a few quirks with known workarounds. Just compile your code with -gstabs, and as long as you use gdb you should be OK. Another option would be to get Robert's patch to gcc and recompile it yourself. Andrew