internal compiler error line 2701 : union issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Ghost Lib 4.0,
which is SDK for Phantom haptic device.

this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};

is there some known fixes to this, which would not lead to this union
structure modification ? (I cannot afford to rewrite this library as I
do not have its sources)

thanks to anyone who may help.

Sebastien MARAUX
 
this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};

Sebastien,

What's the error message you're getting?

Which version of the compiler are you using?

Dave
 
sebastien NO Maraux SPAM said:
I am using Ghost Lib 4.0,
which is SDK for Phantom haptic device.

this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};

It must be something in the code you
don't show. This

union A {
union A* aList;
char b[1];
};

int main()
{
return 0;
}

compiles just fine for me with VC7.1. Try
to reduce the problem to <50LOC that we can
copy'n'paste into our editor.
Generally, I found VC7.1 ICE mostly on "real"
errors, where in other circumstances it would
emit a sensible error message for.
[...]
Sebastien MARAUX


Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
here is the exact error message :

c:\Program Files\SensAble\GHOST\v4.0\external\stl\stl_alloc.h(308):
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information

13 times when compiling my program.

I am compiling a Phantom server from VRPN soft based on ghost SDK
(Phantom Desktop SDK). Seems an issue with GHOST re-declaring its own
stl headers (map, list, string and much more)

ghost stl headers seem to have been given from SGI, reditributable
without fees so I can provide it to whoever wants it (280ko without
complete ghost lib which is copyrighted). the issue is on stl_alloc.h
in this class,
at union _Obj* _M_free_list_link;

//-----------------------------------------------------------

template <bool threads, int inst>
class __default_alloc_template {

private:
// Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former.
# ifndef __SUNPRO_CC
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
# endif
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN -
1)); }

__PRIVATE:
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */
};
//--------------------------------------------------------------------

This works under VC++ 6 (SP5 and probably before), but STL Re
declaration seems to disturb .net 2003 more than 6.0.


Hendrik Schober said:
sebastien NO Maraux SPAM said:
I am using Ghost Lib 4.0,
which is SDK for Phantom haptic device.

this lib does not compile under .net, seemingly because of a union of
this type :

union A {
union A* aList;
char b[1];
};

It must be something in the code you
don't show. This

union A {
union A* aList;
char b[1];
};

int main()
{
return 0;
}

compiles just fine for me with VC7.1. Try
to reduce the problem to <50LOC that we can
copy'n'paste into our editor.
Generally, I found VC7.1 ICE mostly on "real"
errors, where in other circumstances it would
emit a sensible error message for.
[...]
Sebastien MARAUX


Schobi
 
sebastien NO Maraux SPAM said:
[...]
I am compiling a Phantom server from VRPN soft based on ghost SDK
(Phantom Desktop SDK). Seems an issue with GHOST re-declaring its own
stl headers (map, list, string and much more)

You mean it _comes_ with its own STL
headers?
ghost stl headers seem to have been given from SGI, reditributable
without fees so I can provide it to whoever wants it (280ko without
complete ghost lib which is copyrighted).

Have you tried to use the Dinkumware
headers instead???
the issue is on stl_alloc.h
in this class,
at union _Obj* _M_free_list_link;

//-----------------------------------------------------------

template <bool threads, int inst>
class __default_alloc_template {

private:
// Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former.
# ifndef __SUNPRO_CC
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
# endif
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN -
1)); }

__PRIVATE:
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */
};
//--------------------------------------------------------------------

This itself, if I add the missing brace,
compiles fine for me, even if I instanciate
the template. Again, it's somewhere in the
code you didn'nt post.
This works under VC++ 6 (SP5 and probably before), but STL Re
declaration seems to disturb .net 2003 more than 6.0.

The code style does look like STLport (or
the SGI STL, which STLport is derived from).
I seriously doubt that many people have put
effort into getting this to compile with
VC7.1, as the Dinkumware lib coming with it
really is at least as good, most probably
better.
However, I wonder why some 3rd-party code
would come with its own STL. All compilers
come with their std lib nowadays, so there
really is no need for and much potential
harm in adding another one to that. Can't
you just throw the other one away and try
to get the stuff to compile with Dinkumware?
If the code doesn't use too many SGI STL-
specific extensions, this seems the way to
go.


Schobi

--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
 
Back
Top