Path: utzoo!mnetor!uunet!husc6!rutgers!iuvax!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: `noalias' vs `register' Message-ID: <47000026@uxe.cso.uiuc.edu> Date: 17 Dec 87 14:26:00 GMT References: <9817@mimsy.UUCP> Lines: 32 Nf-ID: #R:mimsy.UUCP:9817:uxe.cso.uiuc.edu:47000026:000:726 Nf-From: uxe.cso.uiuc.edu!mcdonald Dec 17 08:26:00 1987 >> f() { >> register int r; >> ... >> r = 1; >> g(); >> if (r == 1) ... >>Does the `if' succeed? Yes, because there is no way for g() to >>alter `r'. >That is true for any auto; "register" has nothing to do with it! >If you mean that there is no way to form a pointer to r, that is >of course correct, but a red herring. Really? int *xxxx; f() { int r; xxxx = &r; r = 1; g(); printf("%d",r); } g(){ *xxxx += 5 ;} 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?) Doug McDonald