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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6c7dea22b75ba442 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder3.cambrium.nl!feeder5.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: ada compiler? References: <1194747665.6151.31.camel@K72> <_evZi.177931$Xa3.50640@attbi_s22> <87hcjq46t4.fsf@ludovic-brenta.org> <473abc9d$0$13104$9b4e6d93@newsspool2.arcor-online.net> <1195035988.599522.87580@50g2000hsm.googlegroups.com> <1195043147.1007.263.camel@kartoffel> <1195052954.315227.220840@o3g2000hsb.googlegroups.com> <1195056238.1007.317.camel@kartoffel> <1195058211.682783.288340@d55g2000hsg.googlegroups.com> <1195061973.1007.342.camel@kartoffel> Date: Wed, 14 Nov 2007 21:40:58 +0100 Message-ID: <87zlxg36hx.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:f8edL8KAktMJZw+9m6K4g7bM53g= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=]`_VHI2[@mme7SRKlOZGKa6`Y6aWje^YjKEFI=MYdock\QlbT;:eK4cXZGRTNPc Georg Bauhaus writes: > Heap overflow seems entirely unrelated at first sight, but in > two ways it needs to be considered here, I think. > > First, the -fstack-check warning suggests, in a sense, to use allocators > and pointers instead of direct objects. When a programmer interprets > the warning this way and starts using pointers, -f[no]-stack-check > is likely to affect the structure of his/her Ada program. No, I don't think -fstack-check suggests changing the program in any way. All it does is insert extra run-time checks. You then convert stack allocation into heap allocation only if and when necessary. I for one almost never use pointers, even in general-purpose (non-safety-critical) programs because I like to use the scope of variables to handle memory and accessibility for me. I see access values and heap allocation as a necessary evil for dynamic data structures, and for the occasional very large array that won't fit on the stack anyway. -- Ludovic Brenta.