stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-643) std::exception declaration incompatible with implementation provided by runtime library on AIX
Date Thu, 27 Mar 2008 07:35:24 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582535#action_12582535
] 

Travis Vitek commented on STDCXX-643:
-------------------------------------

I've already suggested that we try to determine, at configuration time, the size and layout
of the exception classes so that we can emulate them. If we don't go that far, we should at
least add something that will check that the sizes match up and force the library to not compile
if they don't. Something like this...

{noformat}
// looking for runtime library exceptions

#include <exception>
#include <typeinfo>

#include <stdio.h>

template <class T>
void run_test (const char* s)
{
  printf ("#define %-18s %u\n", s, sizeof (T));
}

int main ()
{
#define TEST(s,t) run_test<t>(#s)

  TEST (_RWSTD_EXCEPTION_SIZE     , std::exception);
  TEST (_RWSTD_BAD_ALLOC_SIZE     , std::bad_alloc);
  TEST (_RWSTD_BAD_CAST_SIZE      , std::bad_cast);
  TEST (_RWSTD_BAD_EXCDEPTION_SIZE, std::bad_exception);
  TEST (_RWSTD_BAD_TYPEID_SIZE    , std::bad_typeid);

  return 0;
}
{noformat}

Then we would put something like this near the top of exception.cpp

{noformat}
_RWSTD_NAMESPACE (__rw) {

static void
__rw_exception_compile_asserts ()
{
#define TEST(s,t) _RWSTD_COMPILE_ASSERT (s == sizeof (t))
  TEST (_RWSTD_EXCEPTION_SIZE     , std::exception);
  TEST (_RWSTD_BAD_ALLOC_SIZE     , std::bad_alloc);
  TEST (_RWSTD_BAD_CAST_SIZE      , std::bad_cast);
  TEST (_RWSTD_BAD_EXCDEPTION_SIZE, std::bad_exception);
  TEST (_RWSTD_BAD_TYPEID_SIZE    , std::bad_typeid);
#undef TEST
}

} // namespace rw
{noformat}

> std::exception declaration incompatible with implementation provided by runtime library
on AIX
> ----------------------------------------------------------------------------------------------
>
>                 Key: STDCXX-643
>                 URL: https://issues.apache.org/jira/browse/STDCXX-643
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 19. Diagnostics
>    Affects Versions: 4.2.0
>         Environment: AIX
>            Reporter: Travis Vitek
>             Fix For: 5.0
>
>
> A description of the problem is available here. 
> http://www.nabble.com/19.exceptions.mt.cpp-fails-on-AIX-tf4738595.html
> Essentially we need to add a const char* member to std::exception for AIX. Unfortunately
the fix is a binary incompatible with previous versions of stdcxx.

-- 
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