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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107f24,582dff0b3f065a52 X-Google-Attributes: gid107f24,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2001-08-06 09:57:54 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!nntp-server.caltech.edu!wnoise From: wnoise@ugcs.caltech.edu (Aaron Denney) Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.functional Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Date: 6 Aug 2001 16:42:43 GMT Organization: California Institute of Technology, Pasadena Message-ID: References: <9k9if8$rn3$1@elf.eng.bsdi.com> <3B687EDF.9359F3FC@mediaone.net> <5267be60.0108021911.7d8fe4@posting.google.com> <3B6B637F.E3FA243E@worldnet.att.net> <3b6ea164.1479721766@news.worldonline.nl> Reply-To: wnoise@ugcs.caltech.edu NNTP-Posting-Host: barter.ugcs.caltech.edu User-Agent: slrn/0.9.6.2 (Linux) Xref: archiver1.google.com comp.lang.ada:11392 comp.lang.c:72490 comp.lang.c++:80361 comp.lang.functional:7353 Date: 2001-08-06T16:42:43+00:00 List-Id: On 06 Aug 2001 17:02:55 +0200, Yoann Padioleau wrote: > info@hoekstra-uitgeverij.nl (Richard Bos) writes: > > Ted Dennison wrote: > > > compiler. Remember, "printf" actually has to stop and interpret > > > the input string to look for replacements. > > > > No, it doesn't; not unless the format string isn't a constant. > > Yes it does. The source code from printf is in the C library, so the compiler > cant optimise code such as 'printf("%d %f %s",i,f,str)', he cant > generate print_int(i);print_space(4);print_float(f);.... > This is called partial evaluation, and in practice it is hard to put > in a compiler. In a C compiler, sure. This is also posted to comp.lang.functional and many compilers for functional languages will do partial evaluation at compile-time routinely. -- Aaron Denney -><-