Show: Object Pascal C++
Display Preferences

Resolving Internal Errors (C++)

From Appmethod Topics
Jump to: navigation, search

Go Up to How To Use the Debugger


Internal Compiler Errors

There are three kinds of errors that the C++ compiler generates and that are considered to be ICEs:

All three of these errors result from bugs in the compiler. The <filename> and <line> elements are the point in your source code that the compiler was parsing prior to the error, but they may or may not indicate the source of the problem. The <errorcode> element is a specific information to tell the compiler engineers what the compiler was trying to do when the error occurred.

What to do if you encounter an internal compiler error

  1. Remember that your code may not be at fault.
  2. Try a clean build.
  3. Analyze the source to narrow the problem.
  4. Submit a bug report.

How to perform a clean build

  1. Right-click the project in the Project Manager and select clean.
  2. Check the directory structure to make sure there are no .obj .tds .dcu .#* or .pch files associated with your project.
  3. Choose Build from the Project menu.


How to analyze the source code

If a clean build does not resolve the problem, you may want to analyze the source code to narrow down the problem.

  1. Preprocess the file mentioned in the error message. This can be done by right-clicking the file in the Project Manager and choosing preprocess. This will generate a file with no external dependencies for compilation. It might be a very large file.
  2. Compile the preprocessed file with the -P switch. If this is sufficient to reproduce the problem, you may go straight to step 4.
  3. If the .i file compiled correctly, you may need additional switches to reproduce the problem. Recompile the .i file adding any switches used for the original command line build until you determine which switches are needed to reproduce the problem.
  4. This is enough information to file a bug report. If you do not wish to narrow down the problem any further, please go to the instructions to file a bug report.
  5. You can delete anything after the line where the error occurs and any comments.
  6. Start to comment out function bodies and other portions of code that may not have anything to do with the problem.
  7. As you determine portions that are not necessary to reproduce the problem, you may delete those sections from the .i file.
  8. Once you have narrowed down the code necessary to reproduce the problem, you can then submit a bug report and analyze the type of constructs used to try and find a workaround.

How to file a bug report:

  1. File a new bug report using Quality Portal at quality.embarcadero.com.
  2. Choose Appmethod C++ as the project.
  3. Choose Compiler/C++ as the area.
  4. Enter the command line needed to reproduce the error in the steps of the bug.
  5. Attach the .i file.
  6. Click the check mark button to save the report.

See Also

Personal tools
In other languages