delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/05/23/01:28:43

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Message-ID: <4DD9EDE0.3040904@iki.fi>
Date: Mon, 23 May 2011 08:17:20 +0300
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10
MIME-Version: 1.0
To: djgpp AT delorie DOT com
CC: Jim Michaels <jmichae3 AT yahoo DOT com>
Subject: Re: issue with 4.5.3 beta, 4.5.2 beta
References: <1b5aeeeb-ffaa-42ce-88c4-ec8773bcceef AT j13g2000pro DOT googlegroups DOT com>
In-Reply-To: <1b5aeeeb-ffaa-42ce-88c4-ec8773bcceef@j13g2000pro.googlegroups.com>
Reply-To: djgpp AT delorie DOT com

On 05/23/2011 07:30 AM, Jim Michaels wrote:
> I have a program and small library that I recently worked the bugs out
> of to my best understanding.
> I included a lot of debug output using #if defined(_DEBUG).
> that debug ouput is flushed at every instance.
> the library output shows with -g compiler switch, but not without.
> the main program's debug output always shows.
>
> can someone explain this?  I have the #define on in both the library
> file and the main source and the header file.
> I think I am running into a compiler bug.

Most often (but not always) compiler is not the reason of problems.

> and this doesn't happen with mingw-w64 (a gnu compiler for windows).
>

There could be some hidden bugs that only appear in one environment
(for example due to cleaning or not cleaning memory content on malloc()).

I suggest to try to compile using GCC command line parameters:
    -O2 -Wall -Wextra -Werror
(at -O0 not all warnings are generated) and eliminate all warnings,
which would with these parameters treated as errors. From my experience:
it is rather common to get written application crash at the begin
if these parameters are forgotten while development. Adding them often
reveals then the reason of crash).

You can also try other GCC version for DJGPP

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019