[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [OFFTOPIC] Re: A bit off-topic ... (fwd)
From:       "Jason A. Pfeil" <pfeil () nu ! cs ! fsu ! edu>
Date:       1999-03-31 23:32:41
[Download RAW message or body]

It worked just fine with my g++.

g++ --version returns:  egcs-2.90.29 980515 (egcs-1.0.3 release)

The output was the first statement after the condition, just as expected.

On Wed, 31 Mar 1999, Rivalino Matias Junior wrote:

> 
> On Wed, 31 Mar 1999, J. S. Connell wrote:
> 
> > First, let me say that this message is VASTLY offtopic for the linux-kernel
> > mailing list.  This mailing list is for discussion of the Linux kernel's
> > internals - NOT about basic C programming.
> Sorry.
> 
> > 
> > On Wed, 31 Mar 1999, Rivalino Matias Junior wrote:
> > > The result of x is two. Why ?
> > 
> > My C compiler won't compile that - it claims you're assigning to an invalid
> > lvalue.  
> Okay. Try in C++ compiler (e.g. g++). I'm using g++ in this case.
> 
> >I suspect there's a compiler bug to do with assignments in a
> > ternary operator as the rvalue of an assignment.  
> 
> The expression is correct.
> 
> > Wrapping the two x='s on
> > the right-hand side generates the expected output.
> > 
> No. The expected output is X equal to the result of two other expression 
> (E1,E2), related to condition (y).
>  x= (condition) ? E1 : E2;
> 
> Regards,
> 
> RMJ.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
> 

----  
 Jason A. Pfeil                          pfeil@cs.fsu.edu 
 Network Administrator                   jpfeil@lsi.fsu.edu
 CASDL                                   (850)644-8014; fax: (850)644-4952
 Learning Systems Institute              University Center C-3519
 http://idl.fsu.edu                      Tallahassee, FL  32306-2540


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic