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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: avoiding builtin memset Date: Wed, 26 Apr 2017 16:22:34 +0100 Organization: A noiseless patient Spider Message-ID: 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> <6bff1b83-68c0-4faa-a2db-03df1dd2a108@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="5b4a0556432eb07c6673eeb3967d7d34"; logging-data="26571"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YhK9tnESIjVJgLcbO6M2E8hxheN+e7Mg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) Cancel-Lock: sha1:NJ/18NFj/GCgLChaP2MOVyjcfnY= sha1:ER1ePdW3QPZzXw86eJ2xlUCRZbk= Xref: news.eternal-september.org comp.lang.ada:46634 Date: 2017-04-26T16:22:34+01:00 List-Id: Lucretia writes: > 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. Oh, I was only looking in targparm.adb.