From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd3772840bdf314e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-14 09:46:04 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!sgigate.sgi.com!enews.sgi.com!lll-winken.llnl.gov!sol.ctr.columbia.edu!howland.reston.ans.net!pipex!oleane!jussieu.fr!unilim.fr!cict.fr!news.univ-rennes1.fr!zeus.univ-poitiers.fr!BESNARD From: besnard@zeus.univ-poitiers.fr Newsgroups: comp.lang.ada Subject: porting DEC Ada Motif Binding on Sun with RATIONAL compiler Date: 14 Dec 1994 17:46:04 GMT Organization: Univ. Poitiers, CICUP, France Message-ID: <3cnb0s$929@news.univ-rennes1.fr> Reply-To: besnard@zeus.univ-poitiers.fr NNTP-Posting-Host: zeus.univ-poitiers.fr Date: 1994-12-14T17:46:04+00:00 List-Id: This is a report of my trying to port DEC Ada Motif on Sun: host : SunOS 5.3 (Solaris) sun4m sparc (SPARCclassic) Compiler : Rational Apex 1.4.3 Motif : 1.2 Here are the difficulties that I encountered. They are quite similar as thoses described by Ph. Kipfer and Robb Nebbe, for the porting on Sun with ALSYS and SunAda compilers. - the pragmas INPROVE and INLINE_GENERIC are not recognized. - the pragma export_procedure has no mechanism parameter in rational (it's not important, because all parameter are passed explicitly by value in the DEC binding, and they are implicitly passed by value in Rational) - the "PAD : at 0..-1" fields in many representation clause for record type definition are rejected by the rational compiler. I removed them ... - there is a type mismatch (just one in all the sources) trying to convert an array'address to the system.address type. this occured in the function x_lib.get_error_text: function Get_Error_Text (Display : in Display_Type; ... Buffer_Out : Null_Terminated.String (1 .. 65_535); begin Get_Error_Text (Display, Code, Buffer_Out'Address, Buffer_Out'Length); return Null_Terminated.To_String (C_Types.Char_Pointer (Buffer_Out'Address)); --error end Get_Error_Text; Rational admited it as a bug, and it will be corrected in the next release. Anyway, this problem is easyly bypassed, using an auxiliary variable: ... Buffer_Out : Null_Terminated.String (1 .. 65_535); Buffer_Address : System.Address := Buffer_Out'Address; begin Get_Error_Text (Display, Code, Buffer_Address, Buffer_Out'Length); return Null_Terminated.To_String (C_Types.Char_Pointer (Buffer_Address)); ... - there is also a problem of cyclic dependency between a specification package (x_lib_support) and its body: generic type T is private; Value : in T; function Constant_Function return T; pragma Inline (Constant_Function); ... generic package Derived_Quark_Pkg is type Quark_Type is new Base_Quark_Type; -- function Nul is new Constant_Function -- (Quark_Type, Quark_Type (Base_Quark_0)); function Nul return Quark_Type; -- my correction ---> the instanciation of Constant_Function in Nul function seemed not to be allowed until the former is truly known. So I replaced the instanciation by a declaration of the wanted instance function, and put the instanciation in the body: package body X_Lib_Support is function Constant_Function return T is begin return Value; end Constant_Function; package body Derived_Quark_Pkg is function Nul return Quark_Type is function Nul is new Constant_Function (Quark_Type, Quark_Type (Base_Quark_0)); begin return Nul; end Nul; - finally, I got some frightning warnings, like --- [MID] Element Span for BITMAP_DATA_TYPE is 8 or !!! [MID] Program will raise CONSTRAINT_ERROR (Subtype_Match_Error) at "return TO_TARGET (TO_BITS (S));" (XM_MESSAGE_BOX.TO_POINTER_TYPE.LOCAL_TO_POINTER_TYPE'BODY.2S) or !!! [MID] Unsafe unchecked conversion at "return TO_TARGET (TO_BITS (S));" I have great difficulties with it, because some programs work well (like xm_message_box), and some others don't (like xlib_hello). when running xlib_hello, the program exits, with the report: ---- execute of xlib_hello ---- X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 2 (X_ChangeWindowAttributes) Value in failed request: 0xa0814000 Serial number of failed request: 6 Current serial number in output stream: 12 When debugging, the error seems to raise in the function NEXT_EVENT. I'm still trying to find out why. Help would be welcome ... ------------------------------------------------------------------------- Frederic BESNARD | tel : (19) 49.49.80.70 ENSMA / LISI | fax : (19) 49.49.80.64 BP 109 | e-mail : fb@rabelais.univ-poitiers.fr 86960 FUTUROSCOPE cedex | FRANCE | -------------------------------------------------------------------------