Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#152 Conformance to Ada 2005

closed
nobody
5
2007-07-08
2007-05-14
dmitry-kazakov
No

The generic packages GNU.DB.SQLCLI.Dispatch.A_*, like GNU.DB.SQLCLI.Dispatch.A_Pointer, for example, take an access to a subprogram within the generic body. This became illegal in Ada 2005. The workaround is to declare a constant access type in the package specification. For instance:

with GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute;
pragma Elaborate_All (GNU.DB.SQLCLI.Generic_Attr.Pointer_Attribute);

generic
type Object is private;
type P_Object is access all Object;
package GNU.DB.SQLCLI.Dispatch.A_Pointer is

package Derived is new Attr.Pointer_Attribute (Object, P_Object);
subtype Info is Derived.Attribute_Value_Pair_Pointer;

procedure Register (Index : in Attr.T);
pragma Inline_Always (Register);

private
function Get (Handle : Ctx;
Attribute : Attr.T;
MaxLength : SQLSMALLINT := 0;
Data : Attr.Aux;
ErrorCode : access SQLRETURN)
return Attr.Attribute_Value_Pair'Class;
procedure Set (Handle : in Ctx;
AV_Pair : in Attr.Attribute_Value_Pair'Class;
Data : in Attr.Aux;
ErrorCode : out SQLRETURN);
-- Add the following two lines:
Get_Ptr : constant Attr_Get_Func := Get'Access;
Set_Ptr : constant Attr_Set_Proc := Set'Access;

end GNU.DB.SQLCLI.Dispatch.A_Pointer;

And in the body the procedure Register uses Get_Ptr instead of Get'Access:

procedure Register (Index : in Attr.T) is
begin
Get_Dispatch_Array (Index) := Get_Ptr;
Set_Dispatch_Array (Index) := Set_Ptr;
end Register;

Discussion

  • Logged In: YES
    user_id=146097
    Originator: NO

    Thanks

     
    • status: open --> pending
     
  • Logged In: YES
    user_id=146097
    Originator: NO

    Your bug has been fixed, please retest with the next release.

     
    • status: pending --> closed
     
  • Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).