[Patch] Fix ONE_DIRECTION undef warnings.

Chris Metcalf cmetcalf@tilera.com
Wed Apr 30 20:14:00 GMT 2014


On 4/30/2014 4:06 PM, Roland McGrath wrote:
>> That sounds like you're against the default header design. Could you clarify
>> your position on that?
> I am against anything that is prone to typos introducing silent errors when
> we can come up with an alternative solution that is not a worse maintenance
> burden in other regards.  That is an abstract position and that's all I
> have because I don't have a specific alternative proposal for
> iconv/skeleton.c at the moment.  I'm hoping to encourage other folks like
> you to explore new alternatives that might satisfy my constraints better
> than what we've discussed so far.

In the <arch/chip.h> header for the Tilera architectures we provide macros defining characteristics of the chip like this:

/** Does the chip have an IPI shim? */
#define CHIP_HAS_IPI() 1

This requires code that uses it to do

#if CHIP_HAS_IPI()
...
#endif

Typos then generate a cryptic but uniformly fatal error: missing binary operator before token "(".  The style is aesthetically a bit awkward, but we've become used to it :-)

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com



More information about the Libc-alpha mailing list