Start a conversation

Why are .h and .c files created for each Ada file? I expected the Foo.1.ada file to be converted to Foo.h and the Foo.2.ada to be converted as Foo.c. Instead, I get a pair of .h and .c files for the Foo.1.ada and Foo.2.ada files.

A single Ada source file can have any kind of code within it, though some compilers are more restrictive than that and use specific naming conventions (such as Rational’s .1.ada and .2.ada, or AdaCore’s .ads and .adb). Ada-C/C++ Changer is designed to handle any organization of code within source files. Furthermore, even though a source file might contain only a package spec, it might still have code that needs to be executed when the package is “elaborated.” This code will be placed in the “.c” file for the package spec. Similarly, even though a file might contain only a package body, it might have “subunits” or “inlined” subprograms that need access to its local declarations, and so those are placed in a “.h” file for the body.

Choose files or drag and drop files
Was this article helpful?
  1. MapuSoft

  2. Posted
  3. Updated