[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [RFC] Simplify use of apr_hash_this()

From: Branko Cibej <brane_at_xbc.nu>
Date: Wed, 01 Jul 2009 03:28:19 +0200

Philip Martin wrote:
> So in the same way
>
> svn_wc_entry_t *entry;
> apr_hash_this(... (void*)&entry);
>
> can the compiler assume that calling apr_hash_this doesn't modify
> entry? Does it need whole program optimisation to make this
> assumption? It's because I can't answer questions like this that I
> would rather have temporary variables and no casts.
>

You're right that whole-program optimization doesn't figure in there;
that was a thinko on my part. The aliasing knots are too knotty as it
is, in C. Sigh ...

Well, if (the) compiler(s) issue(s) warnings, we can at least assume
that something's potentially wrong. Since I already know that the type
punning is 'orrible because of pointer type incompatibilities, that's
good enought for me. :)

-- Brane

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2366901
Received on 2009-07-01 03:29:02 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.