This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
volatile unknown in templates, egcs-1.1
- To: egcs-bugs at cygnus dot com
- Subject: volatile unknown in templates, egcs-1.1
- From: Marc Lehmann <pcg at goof dot com>
- Date: Wed, 16 Sep 1998 00:42:12 +0200
With egcs-1.1, I can't compile this program:
template<typename a>
struct x
{
int y(a n) {
__asm__ __volatile__ ("");
}
};
int main()
{
x<int> a;
a.y(5);
}
cerebro:~# g++ -V1.1 -O6 -o x x.C
x.C: In method 'int x<int>::y<int>(int)':
x.C:13: instantiated from here
x.C:5: 'volatile' undeclared (first use this function)
x.C:5: (Each undeclared identifier is reported only once
x.C:5: for each function it appears in.)
x.C:5: warning: qualifier ignored on asm
asm volatile evokes the exact same message. for example, this means you
can't use ntohl in templates with glibc2 ;)
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|