Document: WG14 N1491


Fix for DR 271 (lacuna in iswctype and towctrans)


Submitter: Fred J. Tydeman (USA)
Submission Date: 2010-06-17
Related documents: DR 271
Subject: Fix for DR 271 (lacuna in iswctype and towctrans)

Defect Report 271 has a suggested change to which the committee said:

Since no behavior is specified when desc is zero, for either iswctype() or towctrans(), the behavior is undefined. We do not believe it would be appropriate to add new requirements here.

The Committee believes this should be considered for a future revision of the Standard.

The issue:

Consider the calls:

iswctype (c, wctype (property))
    towctrans (c, wctrans (property))

where property is not valid in the current locale. The wctype and wctrans functions return zero, but the behaviour of iswctype and towctrans is not specified.

Several members believe it would be useful - and considered natural - for them to return 0 ("c does not have this property") and c ("c is unaffected by this mapping") respectively.

The fix:

Append to 7.28.2.2.1#4 [Returns]:

If desc is zero, the iswctype function returns zero (false).

Append to 7.28.3.2.1#4 [Returns]:

If desc is zero, the towctrans function returns the value of wc.

Update DR 271 to point to this document.