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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ebb3574ca8067275 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-01 09:15:34 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!agate!trib.apple.com!amd!netcomsv!telesoft!kst From: kst@alsys.com (Keith Thompson) Subject: Re: Access type representations. Message-ID: Originator: kst@pulsar Sender: news@alsys.com (USENET News Admin @flash) Organization: Alsys, San Diego, CA, USA References: <9410281131.AA15384@eurocontrol.de> Date: Tue, 1 Nov 1994 13:57:35 GMT Date: 1994-11-01T13:57:35+00:00 List-Id: In mg@asp.camb.inmet.com (Mitch Gart) writes: > If you want to pass the address of an Ada string to a C function, > > func(s(s'first)'address) > > should work for all compilers. Unless s is a null string (i.e., s'length = 0); in this case, evaluation of s(s'first) will raise Constraint_Error. In practice, this isn't generally a problem for passing Ada strings to C functions. Since most C string functions expect nul-terminated strings, the Ada code generally needs to append an ASCII.NUL character to the string, which guarantees that it's non-null. -- Keith Thompson (The_Other_Keith) kst@alsys.com TeleSoft^H^H^H^H^H^H^H^H Alsys, Inc. 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718 /user/kst/.signature: I/O error (core dumped)