It looks harmless, but as 'i' is global, the write through 'p' can
change its value, changing the character of the loop. I've actually
seen this type of code appear in 'real' applications.

The new 'restrict' qualifier does help.

-- Terry Greyzck

>Robert Harley <harley@corton.inria.fr> wrote:>>Our moderator wrote:>>>> C lets you alias anything to anything, and that does indeed cause>>> optimization problems. The C9X draft has a "restrict" keyword [...]>>>But ANSI C has a rule which disallows aliasing anything to anything!>>>The rule is that an object in memory can only be accessed through>>lvalues of the same type, possibly in a struct or union, or of char>>type (here the types are considered modulo signed/unsigned and>>qualifiers).