stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-843) [Sun C++] sizeof(mbstate_t) depends on #include order
Date Tue, 08 Apr 2008 23:15:24 GMT
[Sun C++] sizeof(mbstate_t) depends on #include order
-----------------------------------------------------

                 Key: STDCXX-843
                 URL: https://issues.apache.org/jira/browse/STDCXX-843
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 21. Strings
    Affects Versions: 4.2.0
         Environment: Sun C++
            Reporter: Martin Sebor
            Assignee: Martin Sebor
            Priority: Blocker
             Fix For: 4.2.1


The size of the {{mbstate_t}} type and its aliiases (such as {{std::istream::traits_type::state_type)}})
appears to depend on the order in which stdcxx headers are #included:

{noformat}
$ cat u.cpp && gmake u.o && mv u.o v.o && gmake CPPOPTS=-DMAIN u LDOPTS=v.o
&& ./u
#ifdef MAIN

#  include <iomanip>
#  include <istream>

void mbstate_size (size_t);

int main ()
{
    mbstate_size (sizeof (std::istream::traits_type::state_type));
}

#else
#  include <assert.h>
#  include <wchar.h>
#  include <stdio.h>

void mbstate_size (size_t n)
{
    const size_t size = sizeof (mbstate_t);

    printf ("%zu == %zu\n", n, size);
    fflush (stdout);
    assert (n == size);
}
#endif
CC -c -D_RWSTDDEBUG   -mt -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-suncc-5.9-j1-15D/include
-I/amd/devco/sebor/stdcxx/tests/include  -library=%none -g  -m64 +w -errtags -erroff=hidef
  u.cpp
CC -c -D_RWSTDDEBUG   -mt -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-suncc-5.9-j1-15D/include
-I/amd/devco/sebor/stdcxx/tests/include -DMAIN -library=%none -g  -m64 +w -errtags -erroff=hidef
  u.cpp
CC u.o -o u -L/build/sebor/stdcxx-suncc-5.9-j1-15D/rwtest -lrwtest15D -library=%none  -mt
 -m64 -L/build/sebor/stdcxx-suncc-5.9-j1-15D/lib v.o -R/build/sebor/stdcxx-suncc-5.9-j1-15D/lib:/build/sebor/stdcxx-suncc-5.9-j1-15D/rwtest
-lstd15D  -lm 
24 == 32
Assertion failed: n == size, file u.cpp, line 24
Abort (core dumped)
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message