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,a0833bbed8752e1f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: variable length strings Date: Wed, 27 Oct 2004 16:54:40 +0200 Message-ID: <10z8k19febkic.16ex86io5uvwi.dlg@40tude.net> References: <1861614.TWv5A9FgVL@linux1.krischik.com> <4178e979_1@baen1673807.greenlnk.net> <1195374.UMjBCk7lO1@linux1.krischik.com> <1154613.ipZcUgduzp@linux1.krischik.com> <1174011.lJ1dcgRM3Q@linux1.krischik.com> <1098814048.280053@master.nyc.kbcfp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de g/P2nZ8tEU0pUVrLLTx0rgtxHhrMWF90UaqARxTqvYM7LM3no= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:5772 Date: 2004-10-27T16:54:40+02:00 List-Id: On 27 Oct 2004 15:04:31 +0200, Pascal Obry wrote: > Kilgallen@SpamCop.net (Larry Kilgallen) writes: > >> Your "certainly" is misplaced since you do not restrict your claim to >> a particular environment or program. > > I don't know all of them :) And since the goal is to develop programs that > are *safe* (whatever it means for you) I think that such Get_Line > implementation should be avoided. Moreover returning unconstraint objects on > the stack uses lot of stack space (ok, this depends on the > implementation). But the existing Get_Line does not reaches the goal either. Normally it is used with the buffer allocated on the stack. So it is the stack again. Moreover, differently to the "unsafe" version you are forced to allocate more stack than actually needed, to read the longest possible line. Where that upper limit is quite often undeterminable: "as much as the computer can". > Now you are free to choose the implementation you like :) I > will never accept such Get_Line implementation, that's all! Huh, better to have something that works in 99% cases than to face a global memory optimization problem. (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de