www.digitalmars.com         C & C++   DMDScript  

c++ - Internal error: token 879

reply mx0 seznam.cz writes:
Hello,

can please someone tell me what is meaning of error code "Internal error: token
879"?

It comes if I use precompiled headers in dmc (v8.42), and only in release build
(meaning without -g -D, with or without optimization [no difference, always the
same error]) - the same code compiled without using precompiled headers (debug
and release, the same flags as when precompiled headers used) or with
precompiled headers in debug mode, compiles fine without any error or warning.

I found the place where it comes:

in class member function (nonstatic, virtual, in abstract class) there is line:

myStringArray::ConstIterator iter;

- with this line commented out, it compiles without any error; and this line
compiles fine if not using precompiled headers / or using precompiled headers in
debug mode (-g -D the only difference). But in release mode with precompiled
headers it fails.

in headers (are precompiled) there is following code (simplified):

class myStringArray: public myVector< myString > {
..
};

(myString is class)

and

template< class ValueType >
class myIterator {
..
private:
ValueType * m_pObject;
};

template< class Type >
class myVector{
..
public:
typedef Type                ValueType;
typedef myIterator< ValueType >         Iterator;
typedef myIterator< const ValueType >   ConstIterator;
..
};

and even declaration

myVector< myString >::ConstIterator iter;

or

myVector< myString >::Iterator iter;
or
myStringArray::Iterator iter;

did not help, always giving the error "Internal error: token 879".

I know that it is probably non easy task using precompiled headers with class
templates, and I can switch precompiled headers out (dmc is anyway one of the
fastest compilers I know, with reasonably correct c++ support), but it seems to
me strange that it comes only in release build and not in debug build.
Jun 13 2005
parent reply "Walter" <newshound digitalmars.com> writes:
<mx0 seznam.cz> wrote in message news:d8k6et$1stu$1 digitaldaemon.com...
 can please someone tell me what is meaning of error code "Internal error:
token
 879"?
The only way this can be fixed is if you can find a reproducible example, whittle it down to the smallest size, and send it in. Thanks, -Walter
Jun 13 2005
parent reply mx0 seznam.cz writes:
In article <d8lk0u$1c8$2 digitaldaemon.com>, Walter says...
The only way this can be fixed is if you can find a reproducible example,
whittle it down to the smallest size, and send it in.

Thanks,
-Walter
I've build small example; when I tried to cut down the unnecessary code, I have found that the problem has nothing to do with classes, but probably with template expansion. I've attached the zipped example which gives the error, see "ErrOut.txt" in the zip for my output. The sample compiles fine without using precompiled headers, but when trying to compile *.cpp using precompiled header, compilation fails with the strange error message. More strange is, that if I delete one 'x' from the string in PCHtest.hpp template< class ValueType > void TempFunc( void ) { printf( "Some message. xxxxx xxxxxx xxxxx xxxxx xxxx xxxxxx" ); } the sample is compiled fine even using precompiled headers! It seems the problem is related to the string length when using inside template and using precompiled headers. If the function is not declared and used as template (only as regular function), even with longer string, it compiles fine even using precompield headers. Sumarization ... the sample compiles fine in following cases (OR): - the string in the function template is 1 char shorter - the function is declared and used as normal function, not template - precompiled headers not used. begin 0644 PCHtest.ZIP MD9<ESE";2 H9C^WMYNJ!$;6'NH!R2G<=E+%0&^)_D"*9J^:$%.7]W<UE_LA$ MF1>!?(A MR9ONT($8%WXU`1UOPH[?38!00]["FDF12K]<$AS=SSR^G)[*[Z M'K/3?QH8_4H[]I6"A1PJA:J "OZ*'\J)GC*SYCKC6JMS+,UCSB=;.6/(!ECZ M_7(H[K<8JN&A_EXF3JB*[9%MEC92?`%02P,$%``"`` `AES.,AM8EC%H```` M=0````L```!00TAT97-T+F-P<./EXN52SLQ+SBE-2550"G#V*$DM+M'+*"A0 M`HH7%"6FYR8J9*04%9?D%_`"E9;E9Z8HA`"5N)7F)6LH +F:O%S5O%P*0!"2 M+M*&`F1%: P.:=%2?*\)=GRKE$1LB:C5V0AO.V;. SFP55^5;O(1!KNJ))1D M3'HF#UU?'^WPJ]]\ /&$.<_W6:2ER '?_^\1WT6XC>#ZO7D M`!M=SC+[FMIHO````" !```*````17)R3W5T+G1X=(V.,6_",!"%=TO^#V_S M="F9`ADJ(2 *0JV0$!M+&HZ QO%9CHO:?U]'D"Y=>GJWO'OOTZW*4^0A#J?] MJGIV?=TQGIQ8:44K/.;<-Z!1WH.J34J.E6SX[D$M:`T2JJT%]0ZTY+0!4^CJ M_5]0E53]"T/;+-E35-X_?L'-"-ZZR,'5%AR"A!)1.G:8%PNMB.CN6KZQ1:[5 M%``"`` `^US.,A*\6VW_````'P(``` ```````````` `````````&UA:V5F M:6QE4$L!`A0`%``"`` `AES.,AM8EC%H````=0````L```````````` ```` MVFB\````*`$```H```````````` ````F (``$5R<D]U="YT>'102P4&```` ` end
Jun 14 2005
parent "Walter" <newshound digitalmars.com> writes:
Thanks! I can take it from here. -Walter
Jun 14 2005