public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* -fcond-mismatch option
@ 2011-02-20  7:31 ali hagigat
  2011-02-20 13:44 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: ali hagigat @ 2011-02-20  7:31 UTC (permalink / raw)
  To: gcc-help

"-fcond-mismatch
Allow conditional expressions with mismatched types in the second and third
arguments. The value of such an expression is void."
Could any body give an example? What are the second and third
arguments? How they are mismatched? How the conditional expression is
written?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: -fcond-mismatch option
  2011-02-20  7:31 -fcond-mismatch option ali hagigat
@ 2011-02-20 13:44 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2011-02-20 13:44 UTC (permalink / raw)
  To: ali hagigat; +Cc: gcc-help

ali hagigat <hagigatali@gmail.com> writes:

> "-fcond-mismatch
> Allow conditional expressions with mismatched types in the second and third
> arguments. The value of such an expression is void."
> Could any body give an example? What are the second and third
> arguments? How they are mismatched? How the conditional expression is
> written?

Here is an example which gives an error by default but can be compiled
if you use -fcond-mismatch.

struct s1 { int i; };
extern struct s1 f1();
extern char *f2();
void foo(int f) { f ? f1() : f2(); }

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-20 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-20  7:31 -fcond-mismatch option ali hagigat
2011-02-20 13:44 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).