const comparison in C and C++
T. William Wells
bill at proxftl.UUCP
Thu Sep 22 10:33:43 AEST 1988
In article <8529 at smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
: In article <785 at proxftl.UUCP> bill at proxftl.UUCP (T. William Wells) writes:
: >In article <8516 at smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
: >: void copy(const char *source, char *destination, unsigned count);
: >: ... modification of any storage validly accessible via
: >: the second parameter is NOT prohibited.
: >Sorry Doug, it's undefined.
:
: Sorry yourself, it's the way I stated.
:
: >"If an attempt is made to modify an object defined with a
: >const-qualified type through use of an lvalue with
: >non-const-qualified type, the behavior is undefined."
:
: This is simply not relevant. The parameter declarations do not define
: objects.
I see what you mean. I didn't interpret the "defined with" when
reading the section. And I'm not *too* sorry because this means
I don't have to go and fix up that copy routine (and a few
others) in our library. :-)
---
Bill
novavax!proxftl!bill
More information about the Comp.lang.c
mailing list