This is the mail archive of the dwarf2@corp.sgi.com mailing list for the dwarf2 project.


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

PROPOSAL: Add DW_ATE_wchar_t base type for C++


Proposal:  Add DW_ATE_wchar_t per ISO C++


Current Specification
---------------------

Not mentioned or addressed.


Proposed Modifications to the Document
--------------------------------------

Page 37, Sec 5.1 Base Type Entries

Add in Figure 10:

    DW_ATE_wchar_t	C++ wide character type


Immediately following Figure 10, add italicized text as in:

    <i>The DW_ATE_wchar_t base type is included specifically
    for C++ which defines type wchar_t as a "distinct" and "fundamental"
    type (unlike C and C99 where wchar_t is "an integer type" defined in
    stddef.h, presumably by a typedef).</i>


Page 75, Figure 24

Add
    DW_ATE_wchar_t	0x0a


Discussion
----------

The introduction to DWARF V2 section 5.1 is

   <i>A base type is a data tyupe that is not defined in terms of other
   data types. Each programming language has a set of base types that are
   considered to be built into that language.</i>

wchar_t is such a type for C++ (but not for C). So much so that it is
even a keyword (just like int) in C++, (but not for C).

--------------------------------------------------------------------------------
From ISO/IEC FDIS 14882:1998

2.11 - Keywords
...
-1- The identifiers shown in Table ?? are reserved for use as keywords...
...
[In the table is listed wchar_t...]

3.9.1 - Fundamental types
...
-5- Type wchar_t is a distinct type whose values can represent distinct codes
for all members of the largest extended character set specified among the
supported locales (lib.locale). Type wchar_t shall have the same size,
signedness, and alignment requirements (basic.types) as one of the other
integral types, called its underlying type. 
...
-7- Types bool, char, wchar_t, and the signed and unsigned integer types are
collectively called integral types.* 
...

4.2 - Array-to-pointer conversion [conv.array]
...
-2- A string literal (lex.string) that is not a wide string literal can be
converted to an rvalue of type ``pointer to char''; a wide string literal can
be converted to an rvalue of type ``pointer to wchar_t''. In either case, the
result is a pointer to the first element of the array...
...

4.5 - Integral promotions [conv.prom]
...
-2- An rvalue of type wchar_t (basic.fundamental) or an enumeration type
(dcl.enum) can be converted to an rvalue of the first of the following types
that can represent all the values of its underlying type: int, unsigned int,
long, or unsigned long. 
...

5.3.3 - Sizeof [expr.sizeof]
...
...[Note: in particular, sizeof(bool) and sizeof(wchar_t) are implementation-
defined.]...
...



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