From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: 'volatile' undeclared from here Date: 19 Apr 2000 14:20:03 GMT Organization: Aachen University of Technology (RWTH) Lines: 38 Message-ID: <8dkfaj$rk1$1@nets3.rz.RWTH-Aachen.DE> References: <8dk3aa$m6a$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <9LgL4.1906$D21 DOT 3649551 AT nnrp4 DOT proxad DOT net> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 956154003 28289 137.226.32.75 (19 Apr 2000 14:20:03 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 19 Apr 2000 14:20:03 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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"); -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.