Gabriel Kerneis a écrit : > Since you seem to have mastered the Standard far beyond what I managed, > would you mind explaining why the behavior is indeed undefined in the > cases discussed above? I read the relevant sections over and over for > at least an hour and couldn't be convinced by either conclusion (defined > or undefined): I found half a dozen potential "undefined behavior" > related to "++", assignments and sequence points, but no one is obvious > here.
AFAIU if p==&a then a=++(*p) ; is the same as a=++a; which is undefined as it has two effects on "a" between two sequence points. > In other words, are you positive that CIL is not wrong here, or do we > indeed have a bug? There is no bug in Cil with this code: there are multiple assignements to the same variable between two sequence points. This is undefined and therefore Cil is correct whatever it does. The original example is just another example of the same undefinedness. See the answer of John Regher to have the normative reference. Cheers, -- | Benjamin Monate | mailto:benjamin.mon...@cea.fr | | Head of Software Safety Lab. CEA-LIST/DRT/DTSI/SOL/LSL | ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ CIL-users mailing list CIL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cil-users