delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/29/13:08:52

X-Spam-Check-By: sourceware.org
Date: Sun, 29 Jan 2006 13:08:36 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Vadim Oganesyan <vadim DOT oganesyan AT yale DOT edu>
cc: cygwin AT cygwin DOT com
Subject: Re: bizarre g++ behavior after reinstalling cygwin
In-Reply-To: <Pine.LNX.4.63.0601291059100.14268@ajax.its.yale.edu>
Message-ID: <Pine.GSO.4.63.0601291251440.7389@access1.cims.nyu.edu>
References: <Pine DOT LNX DOT 4 DOT 63 DOT 0601291059100 DOT 14268 AT ajax DOT its DOT yale DOT edu>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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
Note-from-DJ: This may be spam

On Sun, 29 Jan 2006, Vadim Oganesyan wrote:

> I just reinstalled cygwin on my laptop (running winXP) and g++ is acting
> most peculiar.
>
> The code that has been working fine for thepast 2~3 months no longer
> works (the programs are still working on other machines). the seem to
> compile OK, but don't generate output files, or generate nonsense, or
> get trapped in loops indefinitely.

We'll need to see actual code snippets that misbehave before we can help.
However, judging by your example below, I can guess that most of these are
against the general C++ coding practices.  GCC 3.4 is much stricter in
that regard than previous versions, and does not necessarily try to make
sense of such code, which is probably what's happening in your case.  Did
you try compiling with "-Wall"?

> Digging in I found that none of the "i=i++" calls inside for-loops work.
> I have never heard of anything of sorts, still changes ++ to +1, this
> fixed the loops, but apparently there are still problems...

"i=i++" is either a no-op or nonsense, depending on the interpretation.
You should either use "i=i+1" or "i++" (those should be equivalent in
modern compilers).

> please help, have i lost my mind?

That's for you to say, but I suspect your code would benefit from some
review and rewrite.  Google for "C++ code style guide".
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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