From mint-bounce@lists.fishpool.fi  Mon Sep  6 17:05:24 2010
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
From: Eero Tamminen <oak@helsinkinet.fi>
Organization: Koti
To: mint@lists.fishpool.fi
Subject: Re: [MiNT] [Highwire] gcc4
Date: Tue, 7 Sep 2010 00:02:50 +0300
User-Agent: KMail/1.9.9
References: <c32bc0c971aa1db91512952b99e881eb-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUNBAjBTXF5bVkYPXkF3CVI6XF1XQkICVllbRg==-webmailer2@server06.w> <201009060023.03041.oak@helsinkinet.fi> <c01e2eb0a96fc247b504936e076a7cc3-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUNBAjBTXF5bVkYPXkF3CVI6XF1XQkIAWlpbRw==-webmailer2@server06.webmailer.hosteurope.de>
In-Reply-To: <c01e2eb0a96fc247b504936e076a7cc3-EhVcX1lFRQVaRwYcDTpQCEFddQZLVF5dQUNBAjBTXF5bVkYPXkF3CVI6XF1XQkIAWlpbRw==-webmailer2@server06.webmailer.hosteurope.de>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <201009070002.50100.oak@helsinkinet.fi>
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: oak@helsinkinet.fi
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>

Hi,

On Monday 06 September 2010, m0n0 wrote:
> Am Sonntag, den 05.09.2010, 23:23 +0200 schrieb Eero Tamminen
> > If something is defined as const, GCC may be doing optimizations
> > that actually assume its contents not to be changing...  It would
> > be much better to use corrent types from the beginning instead of
> > kluding things using casts.
>
> Yes, but many C functions expect char *, so if you wan't to pass
> something that is defined as const char * you have to cast.

Hm, it might be more of an issue for C++ code.  See for example:
http://gcc.gnu.org/onlinedocs/gcc/Temporaries.html#Temporaries


GCC non-bugs doc is also interesting to read:
	http://gcc.gnu.org/bugs/#known

It e.g. tells about how to use and not to use the increment/decrement
operators...


	- Eero


