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-Thread: 103376,de8312f092ea7867 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!not-for-mail From: stefan-lucks@see-the.signature Newsgroups: comp.lang.ada Subject: Re: YACT (Yet Another C Trap) Date: Mon, 30 Aug 2010 10:21:40 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <338f4d05-5b3b-47bd-bff8-76c1488eae6d@x42g2000yqx.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 1283149130 21109 141.54.178.228 (30 Aug 2010 06:18:50 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Mon, 30 Aug 2010 06:18:50 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: Xref: g2news1.google.com comp.lang.ada:13835 Date: 2010-08-30T10:21:40+02:00 List-Id: On Sun, 29 Aug 2010, Maciej Sobczak wrote: > > int x = 10,000; // oops, it will compile, perhaps even without > > warnings. Happy debugging! > > Did you actually tried or are just repeating unchecked nonsense? > The above example is explicitly handled (forbidden) by both C and C++ > standards - comma has special meaning in declarators. I tried it out. The above example gives an error. But the following program compiles without warnings with gcc: #include int main (int argc, char **argv) { float x; x = 12,3; if (x > 12.1) printf("greater"); else printf("smaller or equal"); printf(" than 12.1.\n"); } Here is what it does: > gcc flaw.c > ./a.out smaller or equal than 12.1. Is this a language flaw of C, or a bug in gcc? -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------