www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/26/17:24:05

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 <peda AT lysator DOT liu DOT se>
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>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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

- Raw text -


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