Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: `noalias' vs `register' Message-ID: <6868@brl-smoke.ARPA> Date: 18 Dec 87 22:37:48 GMT References: <9817@mimsy.UUCP> <47000026@uxe.cso.uiuc.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 17 In article <47000026@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: > int *xxxx; > int r; > xxxx = &r; >What would happen if I had said " noalias int r" ? From what has been said, >I have no earthly idea. ( Is it an error? If the compiler could recognize it >as an error, why have it?) About the only error concerning "noalias" you would ever be likely to get would be an attempt to assign a pointer to noalias object into a pointer to plain object without using an explicit cast. (This may manifest itself as a function parameter type mismatch also.) The other direction is legal and safe. You can always take the address of a noalias object with &, obtaining a pointer to noalias object thereby; it would be the attempt to assign the pointer to a pointer to plain object that would generate the error.