This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

1.7: gcc 3.4.4 optimization bug ?


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_";
? ? 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_";
? ? 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.
Also, is gcc 3.4.4 supported on cygwin 1.7 at all ?

Cheers,
Kiran

Attachment: cygcheck.out
Description: Binary data

--
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]