Messages in this thread | | | Subject | Re: [PATCH] C undefined behavior fix | From | Florian Weimer <> | Date | Fri, 04 Jan 2002 09:48:04 +0100 |
| |
Paul Mackerras <paulus@samba.org> writes:
> Richard Henderson writes: > >> On Thu, Jan 03, 2002 at 01:33:27PM +1100, Paul Mackerras wrote: >> > I look forward to seeing your patch to remove all uses of >> > virt_to_phys, phys_to_virt, __pa, __va, etc. from arch/alpha... :) >> >> I don't dereference them either, do I? > > Does that matter?
No, it doesn't. C pointers do not behave like machine addresses, there are additional constraints.
> Also, what does the standard say about casting pointers to integral > types? IIRC you aren't entitled to assume that a pointer will fit in > any integral type, or anything about the bit patterns that you get.
This casting falls into the category "additional language constructs supported by GCC". The standard contains wording which encourages implementors to include a meaningfull conversion from a pointer type to an integral type, but there is no requirement that this has the semantics expected by most programmers. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |