This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

volatile unknown in templates, egcs-1.1



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                        |
                                                          |


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]