Article View: comp.lang.c.moderated
Article #2630Re: pointer casting
From: Network News
Date: Sat, 20 Apr 1996 18:34
Date: Sat, 20 Apr 1996 18:34
16 lines
1308 bytes
1308 bytes
Michal Szymanski <msz@sirius.astrouw.edu.pl> wrote: >So I wonder whether this adjustment is just (nowhere-implemented) possibility >or some real thing? I believe the allowed adjustment is not actually implemented as such anywhere. It would be a waste of time to do so, as one can't portably rely on it. But there are systems where pointers to words take up fewer bits than pointers to bytes, and in such a case the hardware will either do the truncation for you, or complain at the conversion. Are conversions of pointers without the proper alignment actually illegal, i.e. invoking undefined behaviour? It seems to me that an implementation where conversion of an unaligned byte pointer to a word pointer will trap ought to be conforming. -zefram
Technical Details
Message-ID:
<4lbao2$lkd@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4l33mf$7pr@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Network News <news@dcs.warwick.ac.uk> Newsgroups: comp.lang.c.moderated Subject: Re: pointer casting Date: 20 Apr 1996 13:34:42 -0500 Organization: Department of Computer Science, Warwick University, England Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4lbao2$lkd@solutions.solon.com> References: <4l33mf$7pr@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Nntp-Posting-Host: stone X-Stardate: [-31]7381.95 X-Us-Congress: Moronic fuckers