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!news4.google.com!proxad.net!feeder1-2.proxad.net!news.wiretrip.org!news2.arglkargh.de!news.visyn.net!visyn.net!news-2.dfn.de!news.dfn.de!news.uni-jena.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:28:57 +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 1283149566 21882 141.54.178.228 (30 Aug 2010 06:26:06 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Mon, 30 Aug 2010 06:26:06 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: Xref: g2news1.google.com comp.lang.ada:13836 Date: 2010-08-30T10:28:57+02:00 List-Id: On Mon, 30 Aug 2010, stefan-lucks@see-the.signature wrote: > #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. P.S.: Even gcc -Wall doesn't warn about the flawed ",". It just tells me "control reaches end of non-void function" (my main function should return an integer, but it doesn't). > gcc -Wall flaw.c flaw.c: In function 'main': flaw.c:9: warning: control reaches end of non-void function > 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! ------