Re: [PATCH] improve hack in src/base/TextException.h

From: Kinkie <gkinkie_at_gmail.com>
Date: Mon, 21 Feb 2011 08:27:23 +0100

> Sorry, I am not sure I understand the above. Should I reverse r11236 and
> commit a casting fix? Or do you want be to post a patch that some Hudson
> job will pick up and test somehow first?

Why?
Judging from the comment in there it's just meant to trick the
compiler into not (mis)understanding that the FileNameHash function is
unused, because in the end it's invoked via trickery.

IMVHO there are two clean ways out of this:
- use a compiler-dependent thing such as __attribute__((unused)) to
politely inform the compiler that sometimes the programmer knows more
about stuff than the compiler
- just get rid of this whole FileNameHashCached thing as a premature
optimization, and just recalculate the filename hash when we throw a
TextException (which is hopefully not that often)

-- 
    /kinkie
Received on Mon Feb 21 2011 - 07:27:31 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 21 2011 - 12:00:05 MST