Pointer arithmetic

Christopher R Volpe volpe at camelback.crd.ge.com
Thu Jan 10 03:25:02 AEST 1991


In article <14794 at smoke.brl.mil>, gwyn at smoke.brl.mil (Doug Gwyn) writes:
|>The actual error in this code is the mixing of pointers to char and
|>to unsigned char.  If the compiler still complains after that error
|>is remedied, then it has a problem.  Ensuring that pointer arithmetic
|>involves valid operands in this situation is entirely the programmer's
|>responsibility, not the compiler's.  Assuming that everything is declared
|>properly and that the chars string contains all possible runtime values
|>of toupper(...), the above pointer arithmetic (with types fixed) is
|>strictly conforming and thus the C implementation should NOT issue a
|>diagnostic.

I assume you mean "should NOT fail to generate correct code", right?
It can, of course, issue a diagnostic if it's raining outside or if
it's past 5:00pm on a Friday.               
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list