From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: pragmas in doubly linked lists Date: Fri, 27 Jan 2023 18:16:18 +0200 Organization: Tidorum Ltd Message-ID: References: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net qutU6Bin5I4M+mFICecI0g3KUpcOS813TDq+39Q083ihc9FLDK Cancel-Lock: sha1:4SuctW0sQodOM4o1oq0ziQm67nA= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US In-Reply-To: <823bfde7-adb3-4cd2-adca-744cf676864an@googlegroups.com> Xref: reader01.eternal-september.org comp.lang.ada:64895 List-Id: On 2023-01-26 20:25, L. B. wrote: > Hello, > > I'm having issues with cursors of doubly linked lists (erroneous > memory access exceptions). Sounds like a rather common programming error, perhaps trying to dereference pointers that are null. > So I'm wondering whether the pragmas might solve the problems. That is very unlikely, IMO. > What is the purpose of the pragmas defined in the package like > > pragma Preelaborate(Doubly_Linked_Lists); > pragma Preelaborable_Initialization(List); > pragma Preelaborable_Initialization(Cursor); They tell the Ada compiler that the named package and the named types will and should have very simple initialization requirements (default initialization, for the types). They have no (visible) effect on how the program executes and, AIUI, cannot be related to your memory access exceptions. For more explanation, see the Ada RM, http://www.ada-auth.org/standards/22rm/html/RM-10-2-1.html. If you would like help on the memory access exceptions, do describe the problem more in detail here, and perhaps someone can help.