From: stefan-lucks@see-the.signature
Subject: Re: YACT (Yet Another C Trap)
Date: Mon, 30 Aug 2010 10:28:57 +0200
Date: 2010-08-30T10:28:57+02:00 [thread overview]
Message-ID: <Pine.LNX.4.64.1008301026390.28253@medsec1.medien.uni-weimar.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1008301014490.28149@medsec1.medien.uni-weimar.de>
On Mon, 30 Aug 2010, stefan-lucks@see-the.signature wrote:
> #include <stdio.h>
> 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! ------
next prev parent reply other threads:[~2010-08-30 8:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-21 9:32 YACT (Yet Another C Trap) mockturtle
2010-08-27 4:13 ` Shark8
2010-08-29 20:55 ` Maciej Sobczak
2010-08-30 8:21 ` stefan-lucks
2010-08-30 7:52 ` Maciej Sobczak
2010-08-30 8:28 ` stefan-lucks [this message]
2010-08-30 10:13 ` Peter C. Chapin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox