469,909 Members | 1,800 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

internal compiler error line 2701 : union issue

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
Nov 17 '05 #1
4 1840
>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
Nov 17 '05 #2
sebastien NO Maraux SPAM <ma****@ondim.fr> wrote:
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

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Nov 17 '05 #3
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" <Sp******@gmx.de> wrote in message news:<eB**************@TK2MSFTNGP09.phx.gbl>...
sebastien NO Maraux SPAM <ma****@ondim.fr> wrote:
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

Nov 17 '05 #4
sebastien NO Maraux SPAM <ma****@ondim.fr> wrote:
[...]
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

--
Sp******@gmx.de is never read
I'm Schobi at suespammers dot org

"Sometimes compilers are so much more reasonable than people."
Scott Meyers
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Alf P. Steinbach | last post: by
1 post views Thread by Andrew Ward | last post: by
2 posts views Thread by Darren Martz | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.