Newsgroups: comp.std.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: ANSI C standard library Message-ID: <1991May1.170750.19222@zoo.toronto.edu> Date: Wed, 1 May 1991 17:07:50 GMT References: <681@taumet.com> <1991Apr25.201855.27893@watdragon.waterloo.edu> <695@taumet.com> <114913@tut.cis.ohio-state.edu> Organization: U of Toronto Zoology In article <114913@tut.cis.ohio-state.edu> meranda@iguana.cis.ohio-state.edu (deron meranda) writes: >For example, consider the function strchr (section 4.11.5.2). Clearly >if it were implemented entirely in C, it has to produce a plain char * >from a const char *. Although most compilers will allow this with a >warning, it is not strictly-conforming C. Uh, where did you get that idea? Please cite chapter and verse. Some earlier drafts of ANSI C restricted pointer conversions so that this sort of conversion was not strictly conforming; the result was loud protests and the problem was fixed. It is true that you have to beware of alignment in such conversions, but that is not an issue here. It is also true that if you use such a converted pointer to attempt to modify a "const char" variable, all bets are off. But the conversion itself is strictly conforming. -- And the bean-counter replied, | Henry Spencer @ U of Toronto Zoology "beans are more important". | henry@zoo.toronto.edu utzoo!henry