Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
c++ - DMC on large source files
When trying to compile large (approx. 2.2mb) source file I'm getting following error: nbytes = 65600, ph_maxsize = 65520 Internal error: ph 1848 --- errorlevel 1 In c++ beta forum one said its due to macro expansion buffer overflow. Is there any way to tell dmc to use larger buffer or any other way around this problem? Oct 10 2007
did you set -HP in your dmc command line? http://www.digitalmars.com/ctg/sc.html#dashCapHCapP Michael wrote:When trying to compile large (approx. 2.2mb) source file I'm getting following error: nbytes = 65600, ph_maxsize = 65520 Internal error: ph 1848 --- errorlevel 1 In c++ beta forum one said its due to macro expansion buffer overflow. Is there any way to tell dmc to use larger buffer or any other way around this problem? Oct 10 2007
== Quote from chris elliott (biol75 york.ac.uk)'s articledid you set -HP in your dmc command line? http://www.digitalmars.com/ctg/sc.html#dashCapHCapP Oct 10 2007
Michael wrote:When trying to compile large (approx. 2.2mb) source file I'm getting following error: nbytes = 65600, ph_maxsize = 65520 Internal error: ph 1848 --- errorlevel 1 In c++ beta forum one said its due to macro expansion buffer overflow. Is there any way to tell dmc to use larger buffer or any other way around this problem? Oct 10 2007
This happens because of huge switch statement. Huge means number of 'case' statements over 4050. Smallest test case can be produced using following ruby script: === cut === print "int main() {\n" print "\tint i = 0;\n" print "\tswitch(i) {\n" 1.upto(ARGV[0].to_i) do |x| print "\tcase #{x}: goto dummy;\n"; end print "\t}\n" print "dummy:\n" print "\treturn 0;\n" print "}" === cut === Everything else in that huge file compiles fine. Anything can be done about it? Oct 10 2007
Michael wrote:This happens because of huge switch statement. Huge means number of 'case' statements over 4050. Smallest test case can be produced using following ruby script: === cut === print "int main() {\n" print "\tint i = 0;\n" print "\tswitch(i) {\n" 1.upto(ARGV[0].to_i) do |x| print "\tcase #{x}: goto dummy;\n"; end print "\t}\n" print "dummy:\n" print "\treturn 0;\n" print "}" === cut === Everything else in that huge file compiles fine. Anything can be done about it? Oct 11 2007
== Quote from Walter Bright (newshound1 digitalmars.com)'s articleMichael wrote:This happens because of huge switch statement. Huge means number of 'case' statements over 4050. Oct 16 2007
DQNOK wrote:Is it customary nowadays in good compilers to transform switch statements into a set of internal jmps, or do they check thru every case sequentially? How should one deal with 4000 cases? Oct 16 2007
Hello, Walter Bright wrote...In c++ beta forum one said its due to macro expansion buffer overflow. Is there any way to tell dmc to use larger buffer or any other way around this problem? Oct 16 2007
|