public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* template class limit?
@ 1999-06-18 22:53 K. Haley
  1999-06-18 23:08 ` Mumit Khan
  1999-06-30 22:10 ` K. Haley
  0 siblings, 2 replies; 4+ messages in thread
From: K. Haley @ 1999-06-18 22:53 UTC (permalink / raw)
  To: cygwin

Is there a limit to the number of template classes that can be defined?
I'm trying to compile the OWL 6 libraries, but I keep getting an internal
compiler error while trying to instantiate something in bastring or
stl_alloc.  In tracking down this problem I took the basic hello world
program and included various OWL headers until I found one that caused this
error.  I then started copying the header section by section into the
program until the error occurred.  The error occurred when I included the
following class:

template <class R, class P1, class P2>
class TModuleProc2 : public TModuleProc {
  public:
    TModuleProc2(const TModule& module, LPCSTR id) : TModuleProc(module, id) {}

    R operator ()(P1 p1, P2 p2) {
      typedef R (far WINAPI* TProc)(P1 p1, P2 p2);
      return ((TProc)Proc)(p1, p2);
    }
};

This class is used to call a function in a dll that takes two arguments of
type P1 and P2, and has a return type of R.  There are similar classes that
0 to 13 arguments.  Their is also a variation that returns void.  If I
comment out the body of the operator or the entire function operator the
error disappears.  The same is true when I comment out a function in a
previous template class.  Commenting out a non template class has no
effect.  It looks like later template definitions are stepping on earlier ones.

I've tried the base b20.1 compiler, egcs 1.1.2, and the snapshots from Jan
15, June 3, and June 14 with the same results under win98.  Any help on
this would be appreciated.
---
Just another brain dead computer user.

Kenneth Haley < mailto:khaley@bigfoot.com >
My website if your interested http://www.bigfoot.com/~khaley




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: template class limit?
  1999-06-18 22:53 template class limit? K. Haley
@ 1999-06-18 23:08 ` Mumit Khan
  1999-06-30 22:10   ` Mumit Khan
  1999-06-30 22:10 ` K. Haley
  1 sibling, 1 reply; 4+ messages in thread
From: Mumit Khan @ 1999-06-18 23:08 UTC (permalink / raw)
  To: K. Haley; +Cc: cygwin

"K. Haley" <khaley@bigfoot.com> writes:
> Is there a limit to the number of template classes that can be defined?
> I'm trying to compile the OWL 6 libraries, but I keep getting an internal
> compiler error while trying to instantiate something in bastring or
> stl_alloc.  In tracking down this problem I took the basic hello world
> program and included various OWL headers until I found one that caused this
> error.  I then started copying the header section by section into the
> program until the error occurred.  The error occurred when I included the
> following class:

I'm not sure what problem you're seeing. If you can send me a complete
test case, I'll look into it.

The only template limit is the tempalte recursion limit, and that can
be controlled by a -ftemplate-depth=<depth> option when compiling, and
that's obviously not what you're running into.

I know nothing about OWL. If it's a C++ class library, then it's NOT
compatible with GCC (unless it's also compiled with GCC). Sorry.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* template class limit?
  1999-06-18 22:53 template class limit? K. Haley
  1999-06-18 23:08 ` Mumit Khan
@ 1999-06-30 22:10 ` K. Haley
  1 sibling, 0 replies; 4+ messages in thread
From: K. Haley @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

Is there a limit to the number of template classes that can be defined?
I'm trying to compile the OWL 6 libraries, but I keep getting an internal
compiler error while trying to instantiate something in bastring or
stl_alloc.  In tracking down this problem I took the basic hello world
program and included various OWL headers until I found one that caused this
error.  I then started copying the header section by section into the
program until the error occurred.  The error occurred when I included the
following class:

template <class R, class P1, class P2>
class TModuleProc2 : public TModuleProc {
  public:
    TModuleProc2(const TModule& module, LPCSTR id) : TModuleProc(module, id) {}

    R operator ()(P1 p1, P2 p2) {
      typedef R (far WINAPI* TProc)(P1 p1, P2 p2);
      return ((TProc)Proc)(p1, p2);
    }
};

This class is used to call a function in a dll that takes two arguments of
type P1 and P2, and has a return type of R.  There are similar classes that
0 to 13 arguments.  Their is also a variation that returns void.  If I
comment out the body of the operator or the entire function operator the
error disappears.  The same is true when I comment out a function in a
previous template class.  Commenting out a non template class has no
effect.  It looks like later template definitions are stepping on earlier ones.

I've tried the base b20.1 compiler, egcs 1.1.2, and the snapshots from Jan
15, June 3, and June 14 with the same results under win98.  Any help on
this would be appreciated.
---
Just another brain dead computer user.

Kenneth Haley < mailto:khaley@bigfoot.com >
My website if your interested http://www.bigfoot.com/~khaley




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: template class limit?
  1999-06-18 23:08 ` Mumit Khan
@ 1999-06-30 22:10   ` Mumit Khan
  0 siblings, 0 replies; 4+ messages in thread
From: Mumit Khan @ 1999-06-30 22:10 UTC (permalink / raw)
  To: K. Haley; +Cc: cygwin

"K. Haley" <khaley@bigfoot.com> writes:
> Is there a limit to the number of template classes that can be defined?
> I'm trying to compile the OWL 6 libraries, but I keep getting an internal
> compiler error while trying to instantiate something in bastring or
> stl_alloc.  In tracking down this problem I took the basic hello world
> program and included various OWL headers until I found one that caused this
> error.  I then started copying the header section by section into the
> program until the error occurred.  The error occurred when I included the
> following class:

I'm not sure what problem you're seeing. If you can send me a complete
test case, I'll look into it.

The only template limit is the tempalte recursion limit, and that can
be controlled by a -ftemplate-depth=<depth> option when compiling, and
that's obviously not what you're running into.

I know nothing about OWL. If it's a C++ class library, then it's NOT
compatible with GCC (unless it's also compiled with GCC). Sorry.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-06-30 22:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-18 22:53 template class limit? K. Haley
1999-06-18 23:08 ` Mumit Khan
1999-06-30 22:10   ` Mumit Khan
1999-06-30 22:10 ` K. Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).