From: "Alexandre Devaure" Newsgroups: comp.os.msdos.djgpp References: <8dk3aa$m6a$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <9LgL4.1906$D21 DOT 3649551 AT nnrp4 DOT proxad DOT net> <8dkfaj$rk1$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> Subject: Re: 'volatile' undeclared from here Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Wed, 19 Apr 2000 14:25:59 GMT NNTP-Posting-Host: 194.51.236.59 X-Complaints-To: abuse AT proxad DOT net X-Trace: nnrp4.proxad.net 956154359 194.51.236.59 (Wed, 19 Apr 2000 16:25:59 CEST) NNTP-Posting-Date: Wed, 19 Apr 2000 16:25:59 CEST Organization: Guest of ProXad - France To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker a écrit dans le message : 8dkfaj$rk1$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > Alexandre Devaure wrote: > > > template > > class TValueFifo > > { > [...] > > int PutSecure(const T& Value) > > { > > asm volatile ("pushf"); <= the problem is here > > disable(); > > int Error = Put(Value); > > popf(); > > > return Error; > > } > > Compiler error message was: > > > tfifo.h: In method `int TValueFifo::PutSecure(const > > STaskMessage &)': > > taskmgr.cpp:542: instantiated from here > > tfifo.h:35: `volatile' undeclared (first use this function) > > tfifo.h:35: (Each undeclared identifier is reported only once > > tfifo.h:35: for each function it appears in.) > > tfifo.h:35: warning: qualifier ignored on asm > > [Some of the other warnings are also quite nasty, so this is > definitely not the only problem int that code...] > > I've never used or seen anyone use inline assembly in C++ programs, > but even so, one of the things you should try is to replace the > keywords by their ANSI standard-blessed equivalents, > > __asm__ __volatile__ ("pushf"); > I tried and the error message was the same. Alex