Commit 6b267b73 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

change argument types of functions DoFatalError and CmdError (no va_args) in backend

parent 331cea4a
......@@ -191,21 +191,21 @@ Bool CallCompiler (int argc, char **argv)
#endif
else if (strncmp (argv_i, "-sa", 3) == 0){
if (!SetStrictOption (argv[i]+3)){
CmdError ("unknown flag %s", argv[i]);
CmdError ("unknown flag ", argv[i]);
return False;
}
} else if (strcmp (argv_i, "-o") == 0){
if (++i < argc)
output_file_name = argv[i];
else {
CmdError ("no output file given to option -o");
CmdError ("no output file given to option -o",NULL);
return False;
}
} else if (strcmp (argv_i, "-P") == 0){
if (++i < argc)
path_parameter = argv[i];
else {
CmdError ("no path list given to option -P");
CmdError ("no path list given to option -P",NULL);
return False;
}
} else if (strcmp (argv_i, "-RE") == 0){
......@@ -223,7 +223,7 @@ Bool CallCompiler (int argc, char **argv)
# endif
#endif
} else {
CmdError ("file name expected after -RE");
CmdError ("file name expected after -RE",NULL);
return False;
}
} else if (strcmp (argv_i, "-RAE") == 0){
......@@ -241,7 +241,7 @@ Bool CallCompiler (int argc, char **argv)
# endif
#endif
} else {
CmdError ("file name expected after -RAE");
CmdError ("file name expected after -RAE",NULL);
return False;
}
} else if (strcmp (argv_i, "-RO") == 0){
......@@ -259,7 +259,7 @@ Bool CallCompiler (int argc, char **argv)
# endif
#endif
} else {
CmdError ("file name expected after -RO");
CmdError ("file name expected after -RO",NULL);
return False;
}
} else if (strcmp (argv_i, "-RAO") == 0){
......@@ -277,7 +277,7 @@ Bool CallCompiler (int argc, char **argv)
# endif
#endif
} else {
CmdError ("file name expected after -RAO");
CmdError ("file name expected after -RAO",NULL);
return False;
}
} else {
......@@ -287,7 +287,7 @@ Bool CallCompiler (int argc, char **argv)
} else {
/* process (non-flag) argument */
if (fname){
CmdError ("only one input file allowed");
CmdError ("only one input file allowed",NULL);
return False;
}
fname = argv[i];
......@@ -319,7 +319,7 @@ Bool CallCompiler (int argc, char **argv)
if (fname)
return Compile (fname,output_file_name);
else {
CmdError ("no input file given");
CmdError ("no input file given",NULL);
return False;
}
}
......
......@@ -85,7 +85,7 @@ static void ExecCompiler (char *fname,char *output_file_name)
if (hadext)
AddExtension (CurrentFilePath);
} else
CmdError ("No source file specified");
CmdError ("No source file specified",NULL);
}
#ifdef _MAC_
......
......@@ -33,8 +33,6 @@
#include "checksupport.h"
#include "dbprint.h"
extern int VERSION;
/* 'CurrentModule' contains the name of the module that is currently under examination. */
char *CurrentModule;
......@@ -268,15 +266,6 @@ void PrintSymbol (Symbol symbol, File file)
}
} /* PrintSymbol */
#include <stdarg.h>
static char *FindFormatSpecifier (char * format_string)
{
for (; *format_string != '\0' && *format_string != '%'; format_string++)
;
return format_string;
}
void StaticMessage_D_s (Bool error,struct symbol_def *symb_def_p,char *message)
{
if (! (error || DoWarning))
......
/*
system.h
Author: Eric Nocker
At: Department of Computer Science
University of Nijmegen
*/
#define _SYSTEM_
......@@ -47,13 +41,8 @@ extern int FPrintF (File f, char *fmt,...);
extern int FPrintF (); /* (File w, char *fmt,...) */
#endif
#ifdef _VARARGS_
extern void DoFatalError (char *fmt,...);
extern void CmdError (char *errormsg,...);
#else
extern void DoFatalError ();
extern void CmdError ();
#endif
extern void DoFatalError (char *s);
extern void CmdError (char *errormsg1,char *errormsg2);
extern void *Alloc (unsigned long count, SizeT size);
......
......@@ -57,28 +57,19 @@ int FPutS (char *s, File f)
/* Error Handling */
void DoFatalError (char *fmt, ...)
{ va_list args;
va_start (args, fmt);
(void) vfprintf (StdError, fmt, args);
va_end (args);
void DoFatalError (char *s)
{
fputs (s,stderr);
exit (0);
}
void CmdError (char *errormsg,...)
{ va_list args;
va_start (args, errormsg);
void CmdError (char *errormsg1,char *errormsg2)
{
fputs ("Command line error: ", stdout);
vfprintf (stdout, errormsg, args);
fputs (errormsg1, stdout);
if (errormsg2!=NULL)
fputs (errormsg2, stdout);
fputc ('\n', stdout);
va_end (args);
}
/*******************************************************************************
......
......@@ -52,30 +52,19 @@ int FPutS (char *s, File f)
return fputs (s, (FILE *) f);
}
void DoFatalError (char *fmt, ...)
void DoFatalError (char *s)
{
va_list args;
va_start (args, fmt);
(void) vfprintf (stderr, fmt, args);
va_end (args);
fputs (s,stderr);
exit (0);
}
void CmdError (char *errormsg,...)
void CmdError (char *errormsg1,char *errormsg2)
{
va_list args;
va_start (args, errormsg);
fputs ("Command line error: ", stdout);
vfprintf (stdout, errormsg, args);
fputs (errormsg1, stdout);
if (errormsg2!=NULL)
fputs (errormsg2, stdout);
fputc ('\n', stdout);
va_end (args);
}
void *Alloc (long unsigned count, SizeT size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment