Home > Gcc Error > Gcc Error Operation On May Be Undefined

Gcc Error Operation On May Be Undefined

Contents

and then the i++ would have been performed before proceeding to the next statement in the code. My fix avoids the compiler warning and forces a defined behaviour. of the atom whose 1s electron moves nearly at the speed of light? more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed check over here

ntubski View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by ntubski 11-08-2013, 11:03 AM #8 mina86 Member Registered: Aug 2008 Distribution: Slackware share|improve this answer answered Mar 31 '12 at 0:40 ruakh 94.4k10135186 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign there are some rules about _cdecl, more about it, there is a webpage: http://www.programmers-corner.com/tutorial/16 Why do you think a web page that says it specifically and only refers to one version I can't tell what you are referring to as waffling.

Wsequence-point Gcc

Anyway, see the FAQ: http://www.eskimo.com/~scs/C-faq/q3.2.html -David Nov 15 '05 #2 P: n/a Antonio Contreras jimjim wrote: Hello, #include int main(int argc, char *argv[]) { int x = 1; printf("%d %d This is something. The compiler might also swap 4th and 5th operation and the same end result would be produced. how can you tell if the engine is not brand new?

Load variable i to register α. 2. Last edited by dbrazeau; 11-08-2013 at 11:57 AM. I thought the right-of-equal equation is always evaluated first, then assigned to the left-of-equals. –Luv2code Oct 23 '15 at 20:24 add a comment| Your Answer draft saved draft discarded Sign Load variable i to register α. 2.

It's like you're assigning i = ++i; which is also undefined behaviour. What's behind the word "size issues"? It is C not C++ so I am the wrong person to comment on it at all (otherwise my opinion would be not to use unsafe pointer arithmetic at all but Technology is 'stuff that doesn't work yet.' -- Bran Ferren Reply With Quote 10-Mar-2010,04:30 #2 hcvv View Profile View Forum Posts View Blog Entries View Articles Global Moderator Join Date Jun

Save β to j. 5. If the compiler did exactly this with the flaky code, then my fix is valid. Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. That's not the problem.

Werror=sequence-point

Page 1 of 2 12 Last Jump to page: Results 1 to 10 of 15 Thread: gcc: Operation on 'xxx' may be undefined Thread Tools Show Printable Version Subscribe to this their explanation Compute the address to which the value must be written (&a + i * sizeof(a[0])) This things can be done in whatever order the compiler designers decide suits best their target Wsequence-point Gcc Code: i = (i + 1) % 10; should work. C Sequence Point [email protected]:~/src/flop> gcc -v Using built-in specs.

Robert Gamble Nov 15 '05 #31 This discussion thread is closed Start new discussion Replies have been disabled for this discussion. there are some rules about _cdecl, more about it, there is a webpage: http://www.programmers-corner.com/tutorial/16 _cdecl Arguments Passed from Right to Left Calling Function Clears the Stack ‘this' pointer is passed via Technology is 'stuff that doesn't work yet.' -- Bran Ferren Reply With Quote 10-Mar-2010,04:50 #6 martin_helm View Profile View Forum Posts View Blog Entries View Articles Flux Capacitor Penguin Join Date You should consult the compiler's reference to figure out what semantics it is given (or not given, as the error message seems to suggest) to it.

Langford won TWO! Hi there..thx for the reply Is the footnote 70 of 6.5.2 that talks about undefined behavior? 70) This paragraph renders undefined statement expressions such as i = ++i + 1; a[i++] For example: int i = 5; i = i * i; is perfectly legal, and the value of i is accessed twice (the compiler might optimize accesses and remember the value I see you're using Microsoft Outlook Express, which I'm fairly sure should do this for you.

For the purpose of understanding the behavior of existing code, knowing some of the undefined and implementation-specific details can be useful -- as long as you're aware that the details are There are 3 main tasks you should consider: 1. share|improve this answer answered May 16 '12 at 16:55 sepp2k 226k27509541 Thank you very much sepp. –gbhall May 16 '12 at 17:08 add a comment| Your Answer draft

The question does not have to be directly related to Linux and any language is fair game.

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming [SOLVED] warning: operation on 'i' may be undefined [-Wsequence-point] User Name Remember Me? If you need to reset your password, click here. That's why the icrement is needed. Therefore, we must do this.

Why doesn't ${@:-1} return the last element of [email protected]? Why does argv include the program name? Filter columns basing on the value of other column Are the words "expression" and "term" interchangeable in programming language theory? Hello, #include int main(int argc, char *argv[]) { int x = 1; printf("%d %d %d\n", ++x, x, x++); return 0; } Why does the above code when compiled with all

Would you think that this fix meets the original intentions: Code: *Y1_Ptr = *(Y1_Ptr - 1); Y1_Ptr++; Any comments would be helpful. reading through the definition of `\cfrac` in AMSMath Chebyshev Rotation How much is "a ladleful"?