This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __alignof__(T) not compile time constant?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>, gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: 01 Oct 2003 23:56:00 +0200
- Subject: Re: __alignof__(T) not compile time constant?
- Organization: Integrable Solutions
- References: <Pine.LNX.4.44.0309291631060.898-100000@bellatrix.tat.physik.uni-tuebingen.de><m3brt37i8o.fsf@uniton.integrable-solutions.net><3F7B4AA5.1050804@unitus.it>
Paolo Carlini <pcarlini@unitus.it> writes:
| Gabriel Dos Reis wrote:
|
| >The root of the disease is the same as for the PR that talks about
| > alignment in std::basic_string. I promised Paolo that I'll raise the
| > issue. Now seems to be the time.
| >
| [snip]
|
| Thanks Gaby.
|
| If I understand your interesting explanations the front end should be
| fixed to have a true "C++" __alignof__.
It is not really an issue of being able to compute __alignof__. The
issue is that of having the parser correctly digest the __aligned__
attribute.
Try
struct A {
enum { constant = 4 };
__attribute__((__aligned__(constant))) char data;
};
No template involved.
| Unfortunately, I don't think
| this is going to happen "tomorrow", right?
Well, at the moment I'm overbooked and I cannot work on attributes
right now (though I'll be interested in following any discussion/work)
We need:
(1) to fix attributes to play nicely with C++ name lookup rules.
. (2) to be able postpone some attributes until instantiation time;
(3) the previous point means that we are able to do meaningul
substitution into attributes.
The above points need agreements from C++ maintainers and probably
from C maintainers since this issue also affects C/C++ compatibility.
-- Gaby