libgloss/debug.h and mem_err
Joel Sherrill
joel.sherrill@OARcorp.com
Tue Apr 16 09:43:00 GMT 2002
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
More information about the Newlib
mailing list