> Btw, regarding the volatile thing:
> 
> If I do
>       extern volatile struct timecounter *timecounter;
> 
>       microtime()
>       {
>               struct timecounter *tc;
> 
>               tc = timecounter;
> 
> The compiler complains about loosing the volatile thing.
> 
> How do I tell it that it is the contents of the "timecounter" pointer which
> is volatile, but now what it points at ?  I don't want the "tc" pointer to
> be volatile because it obviously isn't.  Do I really need to cast it ?
> 
>               tc = (struct timecounter *)timecounter;

[I see that jdp has answered your question but] cdecl is your friend!

$ cdecl
Type `help' or `?' for help
cdecl> explain volatile struct timecounter *timecounter
declare timecounter as pointer to volatile struct timecounter
cdecl> declare timecounter as volatile pointer to struct timecounter
struct timecounter * volatile timecounter

-- bakul

PS: Chances are most people don't have cdecl any more.  You
    can get it like this:

mkdir cdecl;cd cdecl
fetch 
ftp://gatekeeper.dec.com/pub/usenet/comp.sources.unix/volume14/cdecl2/part0{1,2}.Z
gzcat part01.Z | gunshar
gzcat part02.Z | gunshar
patch <<'EOF'
diff -ru ../cdecl-orig/cdecl.c ./cdecl.c
--- ../cdecl-orig/cdecl.c       Tue Feb  5 14:24:23 2002
+++ ./cdecl.c   Tue Feb  5 12:12:30 2002
@@ -57,6 +57,9 @@
 # include <stddef.h>
 # include <string.h>
 # include <stdarg.h>
+#ifdef BSD
+#include <errno.h>
+#endif
 #else
 # ifndef NOVARARGS
 #  include <varargs.h>
@@ -110,6 +113,9 @@
   void docast(char*, char*, char*, char*);
   void dodexplain(char*, char*, char*, char*);
   void docexplain(char*, char*, char*, char*);
+#ifdef __FreeBSD__
+#define setprogname _bad_bad_bad_FreeBSD
+#endif
   void setprogname(char *);
   int dotmpfile(int, char**), dofileargs(int, char**);
 #else
diff -ru ../cdecl-orig/makefile ./makefile
--- ../cdecl-orig/makefile      Tue Feb  5 14:24:19 2002
+++ ./makefile  Tue Feb  5 12:10:10 2002
@@ -13,7 +13,7 @@
 # add -Ddodebug                To compile in debugging trace statements.
 # add -Ddoyydebug      To compile in yacc trace statements.
 
-CFLAGS= -g -Ddodebug -Ddoyydebug
+CFLAGS= -g -Ddodebug -Ddoyydebug -DBSD
 CC= cc
 ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
 BIN= /usr/lubin
EOF
make
# as root:
make install BIN=/usr/local/bin

No idea if c++decl is valid any more!

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to