Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined Behaviour #33

Open
udit043 opened this issue Aug 8, 2015 · 0 comments
Open

Undefined Behaviour #33

udit043 opened this issue Aug 8, 2015 · 0 comments

Comments

@udit043
Copy link

udit043 commented Aug 8, 2015

   #include "google/gtest/include/gtest/gtest.h"
   int main(int argc,char **argv)
   {
        int x=15;
        printf("%d %d %d %d",x=1,x<20,x*1,x>10);
        return 0;
   }
   Output is : 1 1 1 1 

There should be a warning , function argument evaluations are not sequenced relative to each other. Which means that modifying access to x in x=1 is not sequenced with relation to other accesses, like the one in x*1. The behavior is undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant