Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000301 [1003.1(2008)/Issue 7] System Interfaces Comment Omission 2010-07-30 15:27 2013-04-16 13:06
Reporter geoffclare View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Closed  
Name Geoff Clare
Organization The Open Group
User Reference
Section duplocale
Page Number 743
Line Number 24943
Interp Status Approved
Final Accepted Text Note: 0000549
Summary 0000301: Specify the behaviour of duplocale(LC_GLOBAL_LOCALE)
Description During discussions of LC_GLOBAL_LOCALE on the mailing list,
Glenn Fowler suggested that it would be useful if there was
a way to convert LC_GLOBAL_LOCALE to a usable locale_t object.

This would facilitate application designs where a set of library
functions that do locale-dependent things take a locale_t
argument to tell them which locale to use, and these functions
can then be called from some places with a locale_t obtained from
newlocale() and from others with the locale_t returned by
uselocale((locale_t)0). (If uselocale() returns LC_GLOBAL_LOCALE
then either the library function or its caller would convert it
to a usable locale_t object.)

Currently the only way applications could do this conversion is by
making a series of setlocale() and newlocale() calls to query the
locale name for each category and build up a locale object with
the same settings, but this is cumbersome and would omit any
extra non-standard categories an implementation might have as an
extension. (Note that setlocale(LC_ALL, NULL) cannot be used because
its return string potentially encodes multiple different locale names
and therefore might not be accepted by newlocale().)

Therefore it is proposed to modify the description of duplocale()
so that duplocale(LC_GLOBAL_LOCALE) creates a copy of the global
locale.

I would prefer to see this added sooner rather than later,
although postponing to the next revision would be acceptable if the
group are not comfortable with adding it in a TC.

Desired Action After applying 0000283 change this text that it added:

    The behavior is undefined if the locobj argument is the special
    locale object LC_GLOBAL_LOCALE or is not a valid locale object
    handle.

to:

    If the locobj argument is LC_GLOBAL_LOCALE, duplocale() shall
    create a new locale object containing a copy of the global locale
    determined by the setlocale() function.

    The behavior is undefined if the locobj argument is not a valid
    locale object handle.

After line 24978 add a new paragraph to APPLICATION USAGE:

    The duplocale() function can also be used in conjunction with
    uselocale((locale_t)0). This returns the locale in effect for
    the calling thread, but can have the value LC_GLOBAL_LOCALE.
    Passing LC_GLOBAL_LOCALE to functions such as isalnum_l()
    results in undefined behavior, but applications can convert
    it into a usable locale object by using duplocale().

Cross-volume change to XBD ...

At page 284 line 9451 section <locale.h> change

    used by the uselocale() function

to

    used by the duplocale() and uselocale() functions
Tags tc1-2008
Attached Files

- Relationships
related to 0000582Closedajosey uselocale(0) is poorly specified 

-  Notes
(0000549)
msbrown (manager)
2010-09-16 16:32

Interpretation response
------------------------

The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
See the "Description" section.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Recommendation is to take the action specified in the "Desired Action" section.

- Issue History
Date Modified Username Field Change
2010-07-30 15:27 geoffclare New Issue
2010-07-30 15:27 geoffclare Status New => Under Review
2010-07-30 15:27 geoffclare Assigned To => ajosey
2010-07-30 15:27 geoffclare Name => Geoff Clare
2010-07-30 15:27 geoffclare Organization => The Open Group
2010-07-30 15:27 geoffclare Section => duplocale
2010-07-30 15:27 geoffclare Page Number => 743
2010-07-30 15:27 geoffclare Line Number => 24943
2010-07-30 15:27 geoffclare Interp Status => ---
2010-09-16 16:32 msbrown Interp Status --- => Pending
2010-09-16 16:32 msbrown Note Added: 0000549
2010-09-16 16:32 msbrown Status Under Review => Interpretation Required
2010-09-16 16:32 msbrown Resolution Open => Accepted
2010-09-16 16:32 msbrown Description Updated
2010-09-16 16:33 msbrown Tag Attached: tc1-2008
2010-09-17 09:08 ajosey Interp Status Pending => Proposed
2010-09-17 11:20 geoffclare Final Accepted Text => Note: 0000549
2010-11-11 17:27 ajosey Interp Status Proposed => Approved
2012-06-28 20:06 eblake Relationship added related to 0000582
2013-04-16 13:06 ajosey Status Interpretation Required => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker