title: Interfacing Ada enumerations and C enums
body: <p>Let in C code are defined:</p>
  
  <pre>typedef enum { A=1, B=2 } option_type;
  
  void f(option_type option);</pre>
  
  <p>Let we also have Ada code:</p>
  
  <pre>type Option_Type is (A, B);
  for Option_Type'Size use Interfaces.C.int'Size;
  for Option_Type use (A=>1, B=>2);
  
  X: Option_Type := A;</pre>
  
  <p>Which of the following code is correct (accordingly RM)?</p>
  
  <p>-- First code</p>
  
  <pre>declare
     procedure F (Option: Option_Type)
        with Import, Convention=>C, External_Name=>"f";
  begin
     F(X);
  end;</pre>
  
  <p>or</p>
  
  <p>-- Second code</p>
  
  <pre>declare
     procedure F (Option: Interfaces.C.unsigned)
        with Import, Convention=>C, External_Name=>"f";
     function Conv is new Ada.Unchecked_Conversion(Option_Type, Interfaces.C.unsigned);
  begin
     F(Conv(X));
  end;</pre>
  
  <p>I think both first and second Ada fragments are correct but am not sure.</p>