UCLIBC_HAS_CTYPE_CHECKED option
Rich Felker
dalias at aerifal.cx
Mon Jan 24 18:21:55 UTC 2011
On Mon, Jan 24, 2011 at 12:34:02PM -0500, Mandar Jog wrote:
> There are 3 options to configure "the invalid arg behavior" for table
> based ctypes in uClibc
>
> UCLIBC_HAS_CTYPE_UNSAFE --- "Do not check -- unsafe"
> UCLIBC_HAS_CTYPE_CHECKED --- "Detect and handle appropriately"
> UCLIBC_HAS_CTYPE_ENFORCED --- "Issue a diagnostic and abort()"
>
>
> it seems that option (2) is the best default.
>
> When I run 'make menuconfig' the option chosen by default is (1) ...
> the unsafe option.
> And the uClibc config that ships with BuildRoot has option (3) as the default.
>
>
> It seems like the option (2) should be used in production builds.
> It also makes the behaviour compatible with glibc.
>
> Can you someone shed some light on why this is not the case ?
>
> Any reason why I should not use option(2) in a production build ?
Options 2 and 3 waste space, and 3 is really no better than 1 except
in predictability (3 will definitely crash for invalid arguments,
whereas 1 might crash or might return a bogus result). Option 2 helps
hide bugs.
Rich
More information about the uClibc
mailing list