This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Fix ONE_DIRECTION undef warnings.


On 04/30/2014 01:08 PM, Steve Ellcey wrote:
> On Tue, 2014-04-29 at 17:14 -0400, Carlos O'Donell wrote:
> 
>> Lastly, I hope that we can all agree that:
>>
>> #ifndef ONE_DIRECTION
>> #define ONE_DIRECTION
>> #endif
>>
>> Isn't quite what we want since it silently accepts a particular
>> configuration. We also didn't do a good job of documenting this
>> particular default :-(
> 
> 
> OK, Here is a new (partial) patch for the undef's involving ONE_DIRECTION.
> It undoes my earlier patch and includes defines of ONE_DIRECTION in
> gconv_simple.c, 8bit-generic.c, and 8bit-generic.c.  This does not fix all
> the warnings involving ONE_DIRECTION but it gets rid of several hundred and
> I would like to get this approved and checked in before attacking the rest.
> Unfortunately, it looks like fixing the remaining 100 undefs will require
> one line fixes to 100 different files in iconvdata all of which include
> skeleton.c.
> 
> OK to check this in?
> 
> Steve Ellcey
> sellcey@mips.com
> 
> 
> 2014-04-30  Steve Ellcey  <sellcey@mips.com>
> 
> 	* intl/iconv/skeleton.c (ONE_DIRECTION): Remove define.
> 	* iconv/gconv_simple.c (ONE_DIRECTION): Define.
> 	* iconvdata/8bit-gap.c (ONE_DIRECTION): Ditto.
> 	* iconvdata/8bit-generic.c (ONE_DIRECTION): Ditto.

OK to checkin.

This looks good to me.

Steve, Please don't take my word for it, and if you think this entire
exercise is stupid please say so. However, I agree with Roland that there
is considerable value in fixing up these "macro as interface" issues to
the point where an undefined macro is an error. Particularly when it
comes to ABI issues that might go unnoticed like the Power 2.18 ABI
issue around librt which was fixed by accident.

I agree that fixing this requires mechanical addition of defining
ONE_DIRECTION in each converter as part of the API contract with
using the skeleton.c file. This is core cleanup work that will bear
fruit!

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]