as warning fixes

Peter Naulls peter at chocky.org
Fri Mar 8 02:28:51 PST 2002



This patch should fix most the remaining warnings with the assembler
(with strong warnings turned on)

The patch:
   - Correctly declares functions as static where appropriate
   - Change char * to const char * where appropriate.
   - Change __riscos to __riscos__ (I'd like to deprecate the former
     eventually)
   - Declares constants in a new header file, main.h
     

The only questionable code is in macros.c, where I've changed a "" to a
strdup("") to allow for correct typing.  I'm not sure if this behaviour
is entirely appropriate (potential memory leak).

Main.h and patch as follows

--------------

#ifndef _main_h
#define _main_h

extern int verbose;
extern int pedantic;
extern int fussy;
extern int throwback;
extern int dde;
extern int autocast;
extern int align;
extern int gcc_backend;
extern int gas_backend;
extern int local;
extern int objasm;
extern int uc;
extern int apcs_32bit;
extern int apcs_softfloat;
extern int apcs_fpv3;

#endif

---------------

Index: code.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/code.c,v
retrieving revision 1.2
diff -u -r1.2 code.c
--- code.c	2000/12/27 14:16:26	1.2
+++ code.c	2002/03/08 10:21:31
@@ -11,6 +11,7 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "code.h"
 #include "error.h"
 #include "eval.h"
@@ -275,7 +276,6 @@
     Result.Tag.t = ValueIllegal;
   if (!(Result.Tag.t & legal))
     {
-      extern int fussy, autocast;
       if (autocast && legal & ValueFloat && Result.Tag.t == ValueInt)
 	{
 	  FLOAT f = Result.ValueInt.i;
Index: commands.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/commands.c,v
retrieving revision 1.3.2.4
diff -u -r1.3.2.4 commands.c
--- commands.c	2002/03/01 16:48:22	1.3.2.4
+++ commands.c	2002/03/08 10:21:31
@@ -14,6 +14,7 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "commands.h"
 #include "depend.h"
 #include "error.h"
@@ -40,7 +41,7 @@
 
 
 static Symbol *
-c_define (char *msg, Symbol * sym, ValueTag legal)
+c_define (const char *msg, Symbol * sym, ValueTag legal)
 {
   Value value;
   if (!sym)
@@ -354,13 +355,9 @@
 }
 
 
-extern int verbose;
-
-
 void 
 c_get (void)
 {
-  extern int gcc_backend;
   char *filename, *cptr;
   FILE *getfp;
 
@@ -427,7 +424,7 @@
   filename = strdup (inputRest ());
   if (!filename)
     errorOutOfMem ("c_lnk");
-#ifdef __riscos
+#ifdef __riscos__
   dependPut (" ", filename, "");
 #endif
   for (cptr = filename; *cptr && !isspace (*cptr); cptr++);
Index: decode.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/decode.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 decode.c
--- decode.c	2001/08/04 10:28:47	1.3.2.1
+++ decode.c	2002/03/08 10:21:33
@@ -34,7 +34,7 @@
 
 
 BOOL 
-notinput (char *str)
+notinput (const char *str)
 {
   for (; *str;)
     if (*str++ != inputGetUC ())
@@ -54,7 +54,7 @@
 
 
 static BOOL 
-checkstr (char *str)
+checkstr (const char *str)
 {
   if (notinput (str) || (inputLook () && !isspace (inputGet ())))
     return TRUE;
Index: decode.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/decode.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 decode.h
--- decode.h	2000/11/08 09:38:57	1.1.1.1
+++ decode.h	2002/03/08 10:21:33
@@ -9,7 +9,7 @@
 
 #include "symbol.h"
 
-BOOL notinput (char *str);
+BOOL notinput (const char *str);
 int decode (Lex * label);
 
 #endif
Index: error.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/error.c,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 error.c
--- error.c	2001/08/04 10:28:47	1.2.2.1
+++ error.c	2002/03/08 10:21:33
@@ -30,7 +30,7 @@
 static int no_warnings = 0;
 static char *source = NULL;
 
-#ifdef __riscos
+#ifdef __riscos__
 static int ThrowbackStarted;
 #endif
 
@@ -38,13 +38,13 @@
 char er[1024];
 
 void 
-errorInit (int throwback, char *filename)
+errorInit (char *filename)
 {
   source = filename;
 }
 
 
-#ifdef __riscos
+#ifdef __riscos__
 void 
 errorFinish (void)
 {
@@ -54,7 +54,7 @@
 #endif
 
 
-#ifdef __riscos
+#ifdef __riscos__
 char *
 LF (char *buf)
 {
@@ -94,9 +94,9 @@
   if (ThrowbackStarted > 0)
     ThrowbackSendError (level, lineno, error);
 }
-#endif /* __riscos */
+#endif /* __riscos__ */
 
-#ifndef __riscos
+#ifndef __riscos__
 #define TB(x,y,z,f)
 #endif
 
@@ -133,6 +133,9 @@
 static void 
 doline (int t, long int line, int sameline)
 {
+#ifndef __riscos__
+  t = t;
+#endif
   if (line > 0)
     {
       TB (t, line, errbuf, inputName);
@@ -173,13 +176,13 @@
 void 
 error (ErrorTag e, BOOL c, const char *format,...)
 {
-  char *str;
+  const char *str;
   va_list ap;
   long int line;
   int sameline = 1;
   int t = 0;
 
-#ifdef __riscos
+#ifdef __riscos__
   switch (e)
     {
     case ErrorInfo:
@@ -268,10 +271,10 @@
 errorLine (long int lineno, const char *file,
 	   ErrorTag e, BOOL c, const char *format,...)
 {
-  char *str;
+  const char *str;
   va_list ap;
 
-#ifdef __riscos
+#ifdef __riscos__
   int t;
   switch (e)
     {
Index: error.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/error.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 error.h
--- error.h	2000/11/08 09:38:57	1.1.1.1
+++ error.h	2002/03/08 10:21:33
@@ -13,9 +13,9 @@
 
 extern char er[1024];
 
-void errorInit (int throwback, char *filename);
+void errorInit (char *filename);
 
-#ifdef __riscos
+#ifdef __riscos__
 void errorFinish (void);
 #else
 #define errorFinish()
Index: filestack.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/filestack.c,v
retrieving revision 1.2
diff -u -r1.2 filestack.c
--- filestack.c	2000/12/27 14:16:26	1.2
+++ filestack.c	2002/03/08 10:21:33
@@ -16,6 +16,7 @@
 #include "input.h"
 #include "error.h"
 #include "whileif.h"
+#include "filestack.h"
 
 #define STACKSIZE  10
 
@@ -34,7 +35,7 @@
 
 long int fileCurrentNo;
 
-int 
+int
 push_file (FILE * fp)
 {
   static long int fileNo = 0;
Index: get.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/get.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 get.c
--- get.c	2001/08/04 10:28:47	1.3.2.1
+++ get.c	2002/03/08 10:21:35
@@ -25,7 +25,7 @@
 
 struct reg_id
   {
-    char *name;
+    const char *name;
     int reg_no;
     int len;
   };
@@ -46,7 +46,7 @@
   };                 
 
   Lex lexSym;
-  int loop;
+  unsigned int loop;
   Symbol *sym;
 
   lexSym = lexGetId ();
@@ -85,7 +85,7 @@
 
   Lex lexSym;
   Symbol *sym;
-  int loop;
+  unsigned int loop;
 
   lexSym = lexGetId ();
   if (lexSym.tag == LexNone)
Index: hash.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/hash.c,v
retrieving revision 1.2
diff -u -r1.2 hash.c
--- hash.c	2001/03/20 14:47:31	1.2
+++ hash.c	2002/03/08 10:21:35
@@ -4,6 +4,8 @@
    ** article in CACM 33-6, pp. 677.
  */
 
+#include "hash.h"
+
 int 
 hashstr (char *s, int maxn, int hashs)
 /* s string to hash */
Index: help_cop.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/help_cop.c,v
retrieving revision 1.2
diff -u -r1.2 help_cop.c
--- help_cop.c	2000/12/27 14:16:26	1.2
+++ help_cop.c	2002/03/08 10:21:35
@@ -23,7 +23,7 @@
 #include "reloc.h"
 
 int 
-help_copInt (int max, char *msg)
+help_copInt (int max, const char *msg)
 {
   Value i;
   exprBuild ();
Index: help_cop.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/help_cop.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 help_cop.h
--- help_cop.h	2000/11/08 09:38:57	1.1.1.1
+++ help_cop.h	2002/03/08 10:21:35
@@ -17,7 +17,7 @@
 
 #define FROM_CP_BIT  (1<<20)
 
-int help_copInt (int max, char *msg);
+int help_copInt (int max, const char *msg);
 
 WORD help_copAddr (WORD ir, BOOL stack);
 
Index: include.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/include.c,v
retrieving revision 1.1.1.1.2.2
diff -u -r1.1.1.1.2.2 include.c
--- include.c	2001/12/12 14:57:07	1.1.1.1.2.2
+++ include.c	2002/03/08 10:21:35
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #endif
 
+#include "include.h"
 #include "uname.h"
 
 extern int dde;
Index: lex.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/lex.c,v
retrieving revision 1.3.2.3
diff -u -r1.3.2.3 lex.c
--- lex.c	2002/03/01 16:48:22	1.3.2.3
+++ lex.c	2002/03/08 10:21:36
@@ -13,6 +13,7 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "error.h"
 #include "lex.h"
 #include "local.h"
@@ -22,12 +23,6 @@
 #include "symbol.h"
 #include "area.h"
 #include "os.h"
-
-extern int gcc_backend;
-extern int objasm;
-extern int lexAcornBinop (Lex * lex);
-extern int lexAcornUnop (Lex * lex);
-extern int lexAcornPrim (Lex * lex);
 
 
 const char Pri[2][10] =
Index: lex.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/lex.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 lex.h
--- lex.h	2000/11/08 09:38:57	1.1.1.1
+++ lex.h	2002/03/08 10:21:36
@@ -126,4 +125,11 @@
 int lexNextPri (void);
 
 Lex lexTempLabel (char *, int);
+
+
+extern int lexAcornBinop (Lex * lex);
+extern int lexAcornUnop (Lex * lex);
+extern int lexAcornPrim (Lex * lex);
+
+
 #endif
Index: lexAcorn.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/lexAcorn.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 lexAcorn.c
--- lexAcorn.c	2001/08/06 08:51:02	1.3.2.1
+++ lexAcorn.c	2002/03/08 10:21:36
@@ -10,12 +10,11 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "lex.h"
 #include "input.h"
 #include "decode.h"
 
-extern int apcs_32bit, objasm;		/* c.main */
-
 #define FINISH_STR(string,Op,Pri) \
   if(notinput(string)) goto illegal; \
   lex->LexOperator.op = Op; lex->LexOperator.pri = PRI(Pri); return 1
@@ -69,7 +68,7 @@
     case 's':
       FINISH_STR ("tr:", Op_str, 10);
     default:
-    illegal:if (lex);
+    illegal:;
     }
   lex->tag = LexNone;
   return 0;
@@ -140,7 +139,7 @@
 	}
       break;
     default:
-    illegal:if (lex);
+    illegal:;
     }
   lex->tag = LexNone;
   return 0;
@@ -179,7 +178,7 @@
       lex->tag = LexStorage;
       return 1;
     default:
-    illegal:if (lex);
+    illegal:;
     }
   lex->tag = LexNone;
   return 0;
Index: local.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/local.c,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 local.c
--- local.c	2002/03/01 16:48:22	1.2.2.2
+++ local.c	2002/03/08 10:21:37
@@ -40,7 +40,7 @@
 
 int rout_lblno[100] =
 {0};
-char *rout_id = "Local$$0";
+const char *rout_id = "Local$$0";
 int rout_null = 0;
 static routPos
 * routList = 0, *routListEnd = 0;
@@ -64,9 +64,12 @@
     }
   else
     {
-      rout_id = malloc (16);
-      if (rout_id)
-	sprintf (rout_id, "Local$$%i", rout_null++);
+      char *new_rout_id = malloc (16);
+      if (new_rout_id)
+        {
+          sprintf (new_rout_id, "Local$$%i", rout_null++);
+          rout_id = new_rout_id;
+        }
     }
   if (!rout_id)
     errorOutOfMem ("c_rout");
Index: local.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/local.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 local.h
--- local.h	2000/11/08 09:38:57	1.1.1.1
+++ local.h	2002/03/08 10:21:37
@@ -11,7 +11,7 @@
 #endif
 
 extern int rout_lblno[100];
-extern char *rout_id;
+extern const char *rout_id;
 
 extern const char localFormat[];
 extern int localCurrent;
Index: m_cpu.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/m_cpu.c,v
retrieving revision 1.2
diff -u -r1.2 m_cpu.c
--- m_cpu.c	2000/12/27 14:16:26	1.2
+++ m_cpu.c	2002/03/08 10:21:37
@@ -10,6 +10,7 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "mnemonics.h"
 #include "error.h"
 #include "option.h"
Index: m_cpuctrl.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/m_cpuctrl.c,v
retrieving revision 1.2
diff -u -r1.2 m_cpuctrl.c
--- m_cpuctrl.c	2000/12/27 14:20:13	1.2
+++ m_cpuctrl.c	2002/03/08 10:21:38
@@ -86,7 +86,7 @@
       relocSwi (im);
       break;
     case ValueString:
-#ifdef __riscos
+#ifdef __riscos__
       im.ValueString.s[im.ValueString.len] = 0;
       ir |= switonum (im.ValueString.s);
       if (ir == 0xFFFFFFFF)
Index: m_fpu.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/m_fpu.c,v
retrieving revision 1.2
diff -u -r1.2 m_fpu.c
--- m_fpu.c	2000/12/27 14:20:58	1.2
+++ m_fpu.c	2002/03/08 10:21:38
@@ -356,7 +356,7 @@
   putIns (ir);
 }
 
-void 
+static void 
 flagtransfer (WORD ir)
 {
   WORD op;
@@ -389,7 +389,7 @@
   flagtransfer (M_RFC | cc);
 }
 
-void 
+static void 
 comparelow (WORD ir)		/* No precision and no rounding allowed ? */
 {
   ir |= LHS_OP (getFpuReg ());
Index: macros.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/macros.c,v
retrieving revision 1.3.2.2
diff -u -r1.3.2.2 macros.c
--- macros.c	2002/03/01 16:48:22	1.3.2.2
+++ macros.c	2002/03/08 10:21:39
@@ -64,7 +64,7 @@
 
 
 Macro *
-macroFind (int len, char *name)
+macroFind (size_t len, char *name)
 {
   Macro *m = macroList;
   while (m)
@@ -275,9 +275,10 @@
 {
   int len, bufptr = 0, buflen = 0, i;
   char *ptr, *buf = 0, c;
-  Macro m =
-  {0};				/* zero init */
+  Macro m;
 
+  memset(&m, 0, sizeof(Macro));  
+
   inputExpand = FALSE;
   if (label->tag != LexNone)
     error (ErrorWarning, TRUE, "Label not allowed here - ignoring");
@@ -364,7 +365,7 @@
 		    inputSkip ();
 		  i = 0;
 		  while (i < m.numargs &&
-			 !(strlen (m.args[i]) == len && !strncmp (ptr, m.args[i], len))
+			 !(strlen (m.args[i]) == (size_t)len && !strncmp (ptr, m.args[i], len))
 		    )
 		    i++;
 		  if (i < m.numargs)
@@ -398,7 +399,7 @@
   if (buf)
     buf[bufptr] = 0;
   m.file = inputName;
-  m.buf = buf ? buf : "";
+  m.buf = buf ? buf : strdup("");
   macroAdd (&m);
   return;
 
Index: macros.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/macros.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 macros.h
--- macros.h	2000/11/08 09:38:57	1.1.1.1
+++ macros.h	2002/03/08 10:21:39
@@ -54,7 +54,7 @@
 extern char *macroPtr;
 extern long int macroCurrentCallNo;
 
-Macro *macroFind (int len, char *);
+Macro *macroFind (size_t len, char *);
 void macroCall (Macro *, Lex *);
 BOOL macroGetLine (char *buf);	/* returns 0 if end of macro */
 
Index: main.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/main.c,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 main.c
--- main.c	2001/12/12 14:57:07	1.2.2.1
+++ main.c	2002/03/08 10:21:40
@@ -16,6 +16,7 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "input.h"
 #include "output.h"
 #include "error.h"
@@ -88,9 +89,7 @@
 }
 
 
-extern void as_target (char *);	/* in targetcpu.c */
-
-#ifdef __riscos
+#ifdef __riscos__
 extern int _kernel_setenv (const char *, const char *);
 static char *prefix;
 #else
@@ -105,7 +104,7 @@
 {
   if (!finished || noerrors ())
     outputRemove ();
-#ifdef __riscos
+#ifdef __riscos__
   if (prefix)
     _kernel_setenv ("Prefix$Dir", prefix);
 #endif
@@ -116,7 +115,7 @@
 int
 main (int argc, char **argv)
 {
-#ifdef __riscos
+#ifdef __riscos__
   ProgName = getenv ("Prefix$Dir");
   /* There's a strange problem with Prefix$Dir becoming unset if
    * throwback is used...
@@ -272,7 +271,7 @@
   else
     {
       inputInit (SourceFileName);
-      errorInit (throwback, inputName);
+      errorInit (inputName);
       outputInit (ObjFileName);
       areaInit ();
       setjmp (asmContinue);
@@ -283,7 +282,7 @@
 	fprintf (stdout, "%s: Error when writing object file '%s'.\n", ProgName, ObjFileName);
       else
 	outputAof ();
-#ifdef __riscos
+#ifdef __riscos__
       dependPut ("\n", "", "");
 #endif
       outputFinish ();
Index: os.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/os.h,v
retrieving revision 1.3.2.2
diff -u -r1.3.2.2 os.h
--- os.h	2002/03/01 16:48:22	1.3.2.2
+++ os.h	2002/03/08 10:21:40
@@ -16,7 +16,7 @@
 
 #endif /* CROSS_COMPILE */
 
-#ifdef __riscos
+#ifdef __riscos__
 /* Acorn/RISC OS specific information.  */
 typedef struct os_error
 {
@@ -54,7 +54,7 @@
 char *(toriscos) (char *name, char *oldsuffixes, char newsuffix);
 char *(CanonicalisePath) (const char *path);
 
-#endif /* __riscos */
+#endif /* __riscos__ */
 
 char *CanonicaliseFile (const FILE * path);
 #ifndef strndup
Index: output.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/output.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 output.c
--- output.c	2001/09/07 13:20:58	1.3.2.1
+++ output.c	2002/03/08 10:21:40
@@ -26,7 +26,7 @@
 #include <ctype.h>
 #include <errno.h>
 #endif
-#ifdef __riscos
+#ifdef __riscos__
 #include "depend.h"
 #endif
 
@@ -37,7 +37,7 @@
 #define FIX(n) ((3+(int)n)&~3)
 #define EXTRA(n) (FIX(n)-n)
 
-char *idfn_text = MESSAGE;
+const char *idfn_text = MESSAGE;
 
 #define MAXNAME 256
 static char outname[MAXNAME + 1];
@@ -162,7 +162,7 @@
     remove (outname);
 }
 
-int
+static int
 countAreas (Symbol * ap)
 {
   int i = 0;
@@ -308,7 +308,7 @@
     {
       if (!(ap->area.info->type & AREA_UDATA))
 	{
-	  if (ourword (FIX (ap->value.ValueInt.i)) !=
+	  if ((size_t)ourword (FIX (ap->value.ValueInt.i)) !=
 	      fwrite ((void *) ap->area.info->image, sizeof (char),
 		      ourword (FIX (ap->value.ValueInt.i)), objfile))
 	    {
Index: output.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/output.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 output.h
--- output.h	2000/11/08 09:38:57	1.1.1.1
+++ output.h	2002/03/08 10:21:40
@@ -13,6 +13,6 @@
 
 void outputAof (void);
 
-extern char *idfn_text;
+extern const char *idfn_text;
 
 #endif
Index: reloc.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/reloc.c,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 reloc.c
--- reloc.c	2001/12/18 10:24:41	1.2.2.2
+++ reloc.c	2002/03/08 10:21:41
@@ -185,7 +185,7 @@
 }
 
 
-int
+static int
 relocLate2Reloc (Reloc * r, Value * value)
 {
   int size = 0;
@@ -214,7 +214,7 @@
 }
 
 
-int
+static int
 relocEval (Reloc * r, Value * value, Symbol * area)
 {
   int norelocs = 0;
@@ -319,8 +319,7 @@
 
 
 static void
-relocWrite (Symbol * area, Reloc * r, Value * value,
-	    unsigned char *image)
+relocWrite (Reloc * r, Value * value, unsigned char *image)
 {
   int offset = r->offset;
   WORD w, w1;
@@ -436,7 +435,7 @@
 	case RelocImmN:	/* ? */
 	case RelocFloat:
 	  {
-	    int i;
+	    unsigned int i;
 	    union
 	      {
 		double d;
@@ -501,7 +500,7 @@
 	  relocs->Tag = RelocNone;
 	}
       if (relocs->Tag != RelocNone)	/* We now have a Value */
-	relocWrite (area, relocs, &value, image);
+	relocWrite (relocs, &value, image);
       relocs = relocs->more;
     }
   return norelocs;
Index: riscos_c.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/riscos_c.c,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 riscos_c.c
--- riscos_c.c	2001/09/07 13:20:58	1.2.2.2
+++ riscos_c.c	2002/03/08 10:21:42
@@ -14,9 +14,10 @@
 #include <inttypes.h>
 #endif
 
+#include "main.h"
 #include "error.h"
 
-#ifdef __riscos
+#ifdef __riscos__
 #include "os.h"
 #ifdef UNIXLIB
 #include <unixlib/local.h>
@@ -54,7 +55,6 @@
 }
 
 static char filename[1024];
-extern int dde;
 
 char *
 CanonicalisePath (const char *path1)
@@ -90,7 +90,7 @@
   return 0;			/* keep the compiler happy */
 }
 
-char *
+static char *
 CanonicaliseFile (const FILE * fh)
 {
   int size;
@@ -113,9 +113,10 @@
 
 #else /* not RISC OS */
 
+#if 0
 static char filename[1024];
 
-char *
+static char *
 CanonicaliseFile (FILE * fh)
 /* There's probably an easier way to look up the filename associated with a
  * given handle which doesn't rely on the proc filesystem... */
@@ -135,5 +136,6 @@
   exit (-1);
   return 0;			/* keep the compiler happy */
 }
+#endif
 
-#endif /* !__riscos */
+#endif /* !__riscos__ */
Index: symbol.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/symbol.c,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 symbol.c
--- symbol.c	2001/08/04 10:28:47	1.2.2.1
+++ symbol.c	2002/03/08 10:21:42
@@ -33,7 +33,7 @@
 extern int pedantic;		/* main.c */
 
 static Symbol *
-symbolNew (int len, char *str)
+symbolNew (int len, const char *str)
 {
   Symbol *result;
   if ((result = (Symbol *) malloc (sizeof (Symbol) + len)) != 0)
Index: targetcpu.h
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/targetcpu.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 targetcpu.h
--- targetcpu.h	2000/11/08 09:38:57	1.1.1.1
+++ targetcpu.h	2002/03/08 10:21:43
@@ -28,6 +28,8 @@
 
 extern TargetCPU_t targetCPU;
 
+extern void as_target (char *target);	/* only called from main() */
+
 BOOL cpuWarn (TargetCPU_t);
 
 #endif
Index: value.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/value.c,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 value.c
--- value.c	2002/03/01 16:48:22	1.2.2.2
+++ value.c	2002/03/08 10:21:43
@@ -105,7 +105,7 @@
   return value;
 }
 
-void valueFree(Value value)
+static void valueFree(Value value)
 {
   switch(value.Tag.t) {
     case ValueIllegal:
Index: whileif.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/riscos-aof/as/whileif.c,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 whileif.c
--- whileif.c	2001/12/12 14:57:07	1.3.2.1
+++ whileif.c	2002/03/08 10:21:43
@@ -168,6 +168,8 @@
   WhileBlock *whileNew;
   Value flag;
 
+  label = label;
+
   inputMark ();
   /* Evaluate expression */
   exprBuild ();
@@ -265,6 +267,8 @@
 void 
 c_wend (Lex * label)
 {
+  label = label;
+
   if (!whileCurrent)
     {
       error (ErrorError, TRUE, "Mismatched WEND");



-- 
------------------------------------------------------------------------
 Peter Naulls - peter at chocky.org
 RISC OS Projects Initiative  -  http://www.chocky.org/initiative/
 Java for RISC OS and ARM     -  http://www.chocky.org/java/
 Debian Linux on RiscPCs      -  http://www.chocky.org/debian/
------------------------------------------------------------------------



More information about the gcc mailing list