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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.13.242.195 with SMTP id b186mr17995448ywf.66.1493214242263; Wed, 26 Apr 2017 06:44:02 -0700 (PDT) X-Received: by 10.157.8.17 with SMTP id 17mr824123oty.20.1493214241905; Wed, 26 Apr 2017 06:44:01 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!t52no3783358qtb.0!news-out.google.com!v18ni840ita.0!nntp.google.com!c26no1622189itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 26 Apr 2017 06:44:01 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:c7d:3c35:b000:504d:57d3:d344:1584; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 2a02:c7d:3c35:b000:504d:57d3:d344:1584 References: <934912c8-c189-4d36-8a96-b2aa97e38685@googlegroups.com> <987550450.514781782.903623.laguest-archeia.com@nntp.aioe.org> <8d61281f-e908-4965-a7f4-1e0d4b57c967@googlegroups.com> <20287957.514851298.264687.laguest-archeia.com@nntp.aioe.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6bff1b83-68c0-4faa-a2db-03df1dd2a108@googlegroups.com> Subject: Re: avoiding builtin memset From: Lucretia Injection-Date: Wed, 26 Apr 2017 13:44:02 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:46633 Date: 2017-04-26T06:44:01-07:00 List-Id: On Wednesday, 26 April 2017 08:35:05 UTC+1, Simon Wright wrote: > Luke A. Guest writes: > > > Shark8 wrote: > > > >>> You'll need to export that as the C memset function. > >> > >> Even if you're only using it in Ada functions? > > > > > > Yup, GNAT expects certain functions to be present and generates calls > > to them. Check system.ads for mention of allowing assignment, that > > basically calls memcpy on assignment for objects that require a memory > > copy rather than a register to register copy. > > Not quite sure this is set in system.ads: in the 6.1 sources, the only > reference to memset in the compiler itself is in exp_aggr.adb, See Support_Composite_Assign and the comment inside targparm.ads: -- The assignment of composite objects other than small records and -- arrays whose size is 64-bits or less and is set by an explicit -- size clause may generate calls to memcpy, memmove, and bcopy. -- If versions of all these routines are available, then this flag -- is set to True. If any of these routines is not available, then -- the flag is set False, and composite assignments are not allowed.