Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: Implementat...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 16 of 57 Topic 25153 of 28006
Post > Topic >>

Re: Implementation-defined behaviour

by pete <pfiland@[EMAIL PROTECTED] > Mar 28, 2008 at 04:44 PM

Ioannis Vranos wrote:
> 
> Andrey Tarasevich wrote:
> > Ioannis Vranos wrote:
> >> So, printf("%d "%d\n", x++, x++); invokes implementation-defined
> >> behaviour, while printf("%d\n", x++); doesn't invoke
> >> implementation-defined behaviour?
> >
> > 'printf("%d "%d\n", x++, x++)' invokes _undefined_ behavior.
'printf("%d
> > "%d\n", x++, x)' also invokes _undefined_ behavior.
> >
> > 'printf("%d\n", x++)' does not invoke undefined behavior.
> >
> > "Implementation-defined behavior" is not immediately relevant to the
> > nature of your question.
> 
> K&R2 mentions the following:
> 
> "printf("%d %d\n", ++n, power(2,n));   /* WRONG */
> 
> can produce different results with different compilers, depending on
> whether n is incremented before power is called".
> 
> That's why I call it implementation-defined behaviour.

It's unspecified behavior.
The power(2,n) function call, introduces a sequence point 
that the other code examples don't have.
This is all about sequence points.

-- 
pete
 




 57 Posts in Topic:
Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 04:03:59 
Re: Implementation-defined behaviour
santosh <santosh.k83@[  2008-03-28 07:36:46 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 04:14:48 
Re: Implementation-defined behaviour
santosh <santosh.k83@[  2008-03-28 07:52:41 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-28 17:02:47 
Re: Implementation-defined behaviour
Eric Sosman <esosman@[  2008-03-27 22:14:21 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 04:18:42 
Re: Implementation-defined behaviour
Ian Collins <ian-news@  2008-03-28 15:35:48 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 05:18:31 
Re: Implementation-defined behaviour
"Dann Corbit" &  2008-03-27 20:21:13 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-28 16:58:36 
Re: Implementation-defined behaviour
Andrey Tarasevich <and  2008-03-27 20:22:04 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 14:20:38 
Re: Implementation-defined behaviour
richard@[EMAIL PROTECTED]  2008-03-28 12:30:20 
Re: Implementation-defined behaviour
Antoninus Twink <nospa  2008-03-28 14:29:17 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-28 16:44:12 
Re: Implementation-defined behaviour
CBFalconer <cbfalconer  2008-03-28 19:39:42 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-28 20:25:48 
Re: Implementation-defined behaviour
"Stephen Sprunk"  2008-03-29 18:02:23 
Re: Implementation-defined behaviour
Barry Schwarz <schwarz  2008-03-27 22:23:54 
Re: Implementation-defined behaviour
Philip Potter <pgp@[EM  2008-03-28 09:17:56 
Re: Implementation-defined behaviour
Antoninus Twink <nospa  2008-03-28 14:28:23 
Re: Implementation-defined behaviour
jacob navia <jacob@[EM  2008-03-28 14:57:40 
Re: Implementation-defined behaviour
gazelle@[EMAIL PROTECTED]  2008-03-28 14:23:12 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 16:51:32 
Re: Implementation-defined behaviour
Eric Sosman <esosman@[  2008-03-28 08:35:04 
Re: Implementation-defined behaviour
richard@[EMAIL PROTECTED]  2008-03-28 12:49:58 
Re: Implementation-defined behaviour
Eric Sosman <Eric.Sosm  2008-03-28 10:50:24 
Re: Implementation-defined behaviour
"Dann Corbit" &  2008-03-27 20:19:35 
Re: Implementation-defined behaviour
Barry Schwarz <schwarz  2008-03-27 22:27:34 
Re: Implementation-defined behaviour
"Dann Corbit" &  2008-03-28 00:06:15 
Re: Implementation-defined behaviour
Richard Heathfield <rj  2008-03-28 07:22:08 
Re: Implementation-defined behaviour
"Dann Corbit" &  2008-03-28 00:37:01 
Re: Implementation-defined behaviour
Richard Heathfield <rj  2008-03-28 08:02:22 
Re: Implementation-defined behaviour
"Dann Corbit" &  2008-03-28 01:03:18 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-28 18:58:09 
Re: Implementation-defined behaviour
CBFalconer <cbfalconer  2008-03-28 15:43:45 
Re: Implementation-defined behaviour
Keith Thompson <kst-u@  2008-03-28 19:56:55 
Re: Implementation-defined behaviour
"Herbert Rosenau&quo  2008-03-29 20:10:23 
Re: Implementation-defined behaviour
Willem <willem@[EMAIL   2008-03-29 20:35:44 
Re: Implementation-defined behaviour
lawrence.jones@[EMAIL PRO  2008-03-29 17:10:46 
Re: Implementation-defined behaviour
"Stephen Sprunk"  2008-03-29 18:14:49 
Re: Implementation-defined behaviour
Richard <devr_@[EMAIL   2008-03-28 16:36:53 
Re: Implementation-defined behaviour
gazelle@[EMAIL PROTECTED]  2008-03-28 16:10:32 
Re: Implementation-defined behaviour
Richard <devr_@[EMAIL   2008-03-28 17:56:07 
Re: Implementation-defined behaviour
Richard <devr_@[EMAIL   2008-03-28 18:16:13 
Re: Implementation-defined behaviour
Ben Bacarisse <ben.use  2008-03-28 17:37:46 
Re: Implementation-defined behaviour
"Herbert Rosenau&quo  2008-03-29 20:10:23 
Re: Implementation-defined behaviour
Ioannis Vranos <ivrano  2008-03-29 22:16:27 
Re: Implementation-defined behaviour
Ben Bacarisse <ben.use  2008-03-29 21:50:19 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-28 16:54:38 
Re: Implementation-defined behaviour
Harald van =?UTF-8?b?RMSz  2008-03-28 22:56:39 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-28 20:27:09 
Re: Implementation-defined behaviour
Flash Gordon <spam@[EM  2008-03-29 08:10:44 
Re: Implementation-defined behaviour
Harald van =?UTF-8?b?RMSz  2008-03-29 08:05:51 
Re: Implementation-defined behaviour
Harald van =?UTF-8?b?RMSz  2008-03-29 12:57:39 
Re: Implementation-defined behaviour
pete <pfiland@[EMAIL P  2008-03-29 19:51:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 12:00:08 CST 2008.