X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <4B368CED.3010108@lysator.liu.se> Date: Sat, 26 Dec 2009 23:23:41 +0100 From: Peter Rosin User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: 1.7: gcc 3.4.4 optimization bug ? References: <6a183c930912260945q46e7df73x3f0e4bfba4040466 AT mail DOT gmail DOT com> In-Reply-To: <6a183c930912260945q46e7df73x3f0e4bfba4040466@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Den 2009-12-26 18:45 skrev Kiran Prakash: > Hi, > > I just recently ugraded to cygwin 1.7 > > I was modifying iftop to work on cygwin, when I ran into this little bug. > I'm generally not so quick to blame the compiler, but I can't find any > other explanation. > > > char *tmp, options.interface; > > The following works. > > if (options.interface[0]=='{') > { > tmp=xmalloc( 32+strlen(options.interface) ); > tmp="\\Device\\NPF_"; You need strcpy(tmp, "\\Device\\NPF_") instead of the assignment. > strcat(tmp, options.interface); > xfree(options.interface); > options.interface=tmp; > } > fprintf(stderr, "opening interface:%s\n", options.interface); > > This does not. > > if (options.interface[0]=='{') > { > tmp=xmalloc( 32+strlen(options.interface) ); > tmp="\\Device\\NPF_"; Ditto. > strcat(tmp, options.interface); > xfree(options.interface); > options.interface=tmp; > } > fprintf(stderr, "opening interface:%s\n", tmp); > > command line is gcc -g -O2 -L/usr/lib -o iftop.exe .... > > Certainly looks like an optimization problem. Nope. > Also, is gcc 3.4.4 supported on cygwin 1.7 at all ? Don't know. Cheers, Peter -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple