This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgloss/debug.h and mem_err



debug.h thinks mem_err is not volatile.

All the files that have mem_err seem to think it is.

[joel@mail libgloss]$ grep mem_err */*.c | grep int
mips/lsi33k-stub.c:static volatile int mem_err = 0;
sparc/sparc-stub.c:static volatile int mem_err = 0;
sparc/sparcl-stub.c:static volatile int mem_err = 0;
sparc/sparclet-stub.c:static volatile int mem_err = 0;

This patch fixes it for the sparc.  I have not tried the
mips yet but if it included debug.h, I would think it
would have the same problem.

What's the right fix?  This works for sparc:

Index: debug.h
===================================================================
RCS file: /cvs/src/src/libgloss/debug.h,v
retrieving revision 1.1
diff -u -r1.1 debug.h
--- debug.h	17 Mar 2000 22:48:49 -0000	1.1
+++ debug.h	16 Apr 2002 16:42:52 -0000
@@ -77,7 +77,7 @@
  * indicate to caller of mem2hex or hex2mem that there has been an
error. 
  * 0 means ok, 1 means error
  */
-extern int mem_err;
+extern volatile int mem_err;
 
 /*
  * indicate whether the debug vectors have been initialized


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


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