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 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news-2.dfn.de!news.dfn.de!news.uni-weimar.de!not-for-mail From: stefan-lucks@see-the.signature Newsgroups: comp.lang.ada Subject: Re: C++0x and Threads - a poor relation to Ada's tasking model? Date: Wed, 12 Aug 2009 07:29:32 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <7q2385104kihs87d79p8kfphuoki6r01vq@4ax.com> <81a101a3-b46e-4268-973c-356c6119ee2b@c14g2000yqm.googlegroups.com> Reply-To: stefan-lucks@see-the.signature NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: tigger.scc.uni-weimar.de 1250065317 2383 141.54.178.228 (12 Aug 2009 08:21:57 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Wed, 12 Aug 2009 08:21:57 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: <81a101a3-b46e-4268-973c-356c6119ee2b@c14g2000yqm.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:7691 Date: 2009-08-12T07:29:32+02:00 List-Id: On Wed, 12 Aug 2009, Maciej Sobczak wrote: > A very simple example is the printf function [...]: > > #include > int main() > { > int s = 1234; > std::printf("%s\n", s); > } > > Above, std::printf, even though not formally a keyword, has attracted > the compiler's attention and allowed it to perform type checks that > are not mandated by the language itself. This is easy, since "%s\n" is a constant. Try "printf(someString, a, b, c, d);", where someString is a variable. (This is valid C. I didn't check for C++, but I expect C++ to allow variable format strings, just as well.) -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------