This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31870] Failure to diagnose taking address of register variable
- From: "bangerth at math dot tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 May 2007 22:46:34 -0000
- Subject: [Bug c/31870] Failure to diagnose taking address of register variable
- References: <bug-31870-6@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from bangerth at math dot tamu dot edu 2007-05-09 23:46 -------
Subject: Re: Failure to diagnose taking address of register
variable
> > for that case, C99's clause 6.3.2.1/3 says that that's possible for
> > register storage class arrays but that the result is undefined.
>
> Right. GCC seems to want to diagnose this undefined behaviour; it
> does in all other circumstances.
It probably wouldn't hurt if it were diagnosed, but since the result of
the expression is thrown away anyway, there probably isn't much hurm done
in the current state either.
I agree that we might want to warn, but I wouldn't consider it very high
priority.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31870