From: j DOT aldrich6 AT genie DOT com Message-Id: <199603010425.AA066374348@relay1.geis.com> Date: Fri, 1 Mar 96 04:24:00 UTC 0000 To: djgpp AT delorie DOT com Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Subject: Re: GDB discovers another one! Reply to message 6739985 from ELIZ AT IS DOT ELTA. on 02/29/96 6:13AM > Don't put the line which enlarges `_stklen' in a header file included by > more than one source file, because then you are initializing a global > variable more than once, and the linker won't let you do this. Instead, > include that line in a *single* source file. It's best to do this on the > source file which defines the function that actually needs a large stack > (that way, if you decide someday to make it part of a library, you won't > get mysterious crashes), but any file will do. > The warning that tells you that `_stklen' is both declared extern and > initialized should go away if you remove `extern' from the declaration, > like this: > > unsigned _stklen = ... I realize that you can't initialize and declare extern at once, but I was assuming that since both the FAQ and the documentation for _stklen told me to do it that way, it was somehow correct in that one case. Doesn't this mean that boththe FAQ and the docs are incorrect? Twould be a good idea to fix them before somebody else has problems. :) Anyway, I solved my problem by declaring _stklen extern in all of my program files, and only defining it in the main program file. Since then, everything has worked fine. BTW, it seems to me that stubediting the executable is an even worse idea than the FAQ suggests, because it would only work with the executable itself, not the coff, so programs like gdb and gprof would use the program with the wrong stack size, wouldn't they? Could get rather messy... John