Next: , Previous: , Up: Implementation Defined Pragmas   [Contents][Index]


2.19 Pragma C_Pass_By_Copy

Syntax:

pragma C_Pass_By_Copy
  ([Max_Size =>] static_integer_EXPRESSION);

Normally the default mechanism for passing C convention records to C convention subprograms is to pass them by reference, as suggested by RM B.3(69). Use the configuration pragma C_Pass_By_Copy to change this default, by requiring that record formal parameters be passed by copy if all of the following conditions are met:

If these conditions are met the argument is passed by copy; i.e., in a manner consistent with what C expects if the corresponding formal in the C prototype is a struct (rather than a pointer to a struct).

You can also pass records by copy by specifying the convention C_Pass_By_Copy for the record type, or by using the extended Import and Export pragmas, which allow specification of passing mechanisms on a parameter by parameter basis.