#define ICK_IE778 "778 UNEXPLAINED COMPILER BUG\n\
ON THE WAY TO %d\n"
-extern void /*@noreturn@*/ ick_lose(char *m, int n, /*@null@*/ char *s)
+extern void /*@noreturn@*/ ick_lose(const char *m, int n, /*@null@*/ const char *s)
#ifdef __GNUC__
__attribute__ ((noreturn))
#endif
int ick_checkforbugs; /* AIS */
/*@-formatconst@*/
-void ick_lose(char *m, int n, char *s)
+void ick_lose(const char *m, int n, const char *s)
{
(void) fflush(stdout); /* AIS: To stop stdout getting muddled with stderr*/
(void) fprintf(stderr,
}
/* AIS: This function reports potential bugs. It's paraphrased from ick_lose. */
-void ick_lwarn(char *m, int n, char *s)
+void ick_lwarn(const char *m, int n, const char *s)
{
if(!ick_checkforbugs) return; /* Don't report a potential bug without -l */
(void) fflush(stdout);
extern int ick_lineno;
-extern void /*@noreturn@*/ ick_lose(char *m, int n, /*@null@*/ char *s)
+extern void /*@noreturn@*/ ick_lose(const char *m, int n, /*@null@*/ const char *s)
#ifdef __GNUC__
__attribute__ ((noreturn))
#endif
;
-extern void ick_lwarn(char *m, int n, /*@null@*/ char *s);
+extern void ick_lwarn(const char *m, int n, /*@null@*/ const char *s);
/* ick_lose.h ends here */
static unsigned int maxsmalls[8] =
{0, 0, 65535, 59048, 65535, 15624, 46655, 16806};
-/*@observer@*/ static char *compiler;
+/*@observer@*/ static const char *compiler;
atom *oblist = NULL, *obdex;
int obcount = 0;
/*@-noeffect@*/ (void) signim; /*@=noeffect@*/
ick_lose(IE778, iyylineno, (char *)NULL);
}
-static void print_usage(char *prog, char *options)
+static void print_usage(const char *prog, const char *options)
{
fprintf(stderr,"Usage: %s [-%s] <file> [<file> ...]\n",prog,options);
fprintf(stderr,"\t-b\t:reduce the probability of E774 to zero\n");
fprintf(stderr,"\t\tfor base 2 or .3i, etc., for base 3, etc.).\n");
}
+#if __DJGPP__
/* AIS: Determine whether an environment variable exists (this is used to
find a temp directory) */
-int isenv(char* e)
+static int isenv(char* e)
{
char* x=getenv(e);
return x != NULL && *x != '\0';
}
+#endif
/*@-redef@*/
int main(int argc, char *argv[])
atom *op;
int c, i;
/*@-shadow@*/ /* no it doesn't, cesspool isn't linked to perpet */
- char *includedir, *libdir, *ick_datadir;
+ const char *includedir, *libdir, *ick_datadir;
/*@=shadow@*/
/* AIS: removed getenv(), added ick_datadir */
- char *cooptsh; /* AIS */
+ const char *cooptsh; /* AIS */
FILE *ifp, *ofp;
int maxabstain, /* nextcount, AIS */ bugline;
ick_bool needsyslib, firstfile;
along the same lines as CLC-INTERCAL's preloads. Search for
it in the usual places, then make a copy in a temp directory
and substitute that on the command line. */
- char* tempfn;
+ const char* tempfn;
FILE* fromcopy;
FILE* tocopy;
int c2;
FILE* cioallec;
char* buf2ptr;
long remspace;
- char* tempfn="ickectmp.c";
+ const char* tempfn="ickectmp.c";
int needc99=0;
#if __DJGPP__
/* Look for a temp directory, as above. */
/* Options that might affect this */
int ick_printfopens=0;
-/*@dependent@*/ /*@null@*/ FILE* ick_debfopen(/*@observer@*/ char* fname,
- /*@observer@*/ char* mode)
+/*@dependent@*/ /*@null@*/ FILE* ick_debfopen(/*@observer@*/ const char* fname,
+ /*@observer@*/ const char* mode)
{
FILE* t;
if(ick_printfopens) fprintf(stderr,"Trying to open '%s'...\n",fname);
overflows, instead truncating filenames (and if that manages to find them,
I'll be incredibly surprised). It also tries argv[0]/../lib and
argv[0]/../include (where they are when running without installing). */
-/*@dependent@*/ /*@null@*/ FILE* ick_findandfopen(/*@observer@*/ char* file,
- /*@observer@*/ char* guessdir,
- /*@observer@*/ char* mode,
- /*@observer@*/ char* argv0)
+/*@dependent@*/ /*@null@*/ FILE* ick_findandfopen(/*@observer@*/ const char* file,
+ /*@observer@*/ const char* guessdir,
+ /*@observer@*/ const char* mode,
+ /*@observer@*/ const char* argv0)
{
static char buf2[BUFSIZ];
- /*@observer@*/ static char *fileiter;
+ /*@observer@*/ static const char *fileiter;
size_t i = 0, j;
FILE* ret;
while(*guessdir != '\0' && i<BUFSIZ-2) buf2[i++] = *guessdir++;
}
/* AIS: The same, looking for an executable */
-/*@observer@*/ /*@null@*/ char* ick_findandtestopen(/*@observer@*/ char* file,
- /*@observer@*/ char* guessdir,
- /*@observer@*/ char* mode,
- /*@observer@*/ char* argv0)
+/*@observer@*/ /*@null@*/ const char* ick_findandtestopen(/*@observer@*/ const char* file,
+ /*@observer@*/ const char* guessdir,
+ /*@observer@*/ const char* mode,
+ /*@observer@*/ const char* argv0)
{
static char buf2[BUFSIZ];
- /*@observer@*/ static char *fileiter;
+ /*@observer@*/ static const char *fileiter;
size_t i = 0, j;
FILE* ret;
while(*guessdir != '\0' && i<BUFSIZ-2) buf2[i++] = *guessdir++;
}
/* AIS: The same thing, but with freopen */
-/*@dependent@*/ /*@null@*/ FILE* ick_findandfreopen(/*@observer@*/ char* file,
- /*@observer@*/ char* guessdir,
- /*@observer@*/ char* mode,
- /*@observer@*/ char* argv0,
+/*@dependent@*/ /*@null@*/ FILE* ick_findandfreopen(/*@observer@*/ const char* file,
+ /*@observer@*/ const char* guessdir,
+ /*@observer@*/ const char* mode,
+ /*@observer@*/ const char* argv0,
FILE* over)
{
- char* s=ick_findandtestopen(file,guessdir,mode,argv0);
+ const char* s=ick_findandtestopen(file,guessdir,mode,argv0);
if(s != NULL)
return freopen(s,mode,over);
else
#include "config.h"
-/*@null@*/ /*@dependent@*/ extern FILE* ick_debfopen(/*@observer@*/ char*, /*@observer@*/ char*);
-/*@null@*/ /*@dependent@*/ extern FILE* ick_findandfopen(/*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*);
-/*@observer@*/ /*@null@*/ extern char* ick_findandtestopen(/*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*);
-/*@null@*/ /*@dependent@*/ extern FILE* ick_findandfreopen(/*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, /*@observer@*/ char*, FILE*);
+/*@null@*/ /*@dependent@*/ extern FILE* ick_debfopen(/*@observer@*/ const char*, /*@observer@*/ const char*);
+/*@null@*/ /*@dependent@*/ extern FILE* ick_findandfopen(/*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*);
+/*@observer@*/ /*@null@*/ extern const char* ick_findandtestopen(/*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*);
+/*@null@*/ /*@dependent@*/ extern FILE* ick_findandfreopen(/*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, /*@observer@*/ const char*, FILE*);
int weaving=0; /* Weave newly created threads? */
/* Printflow debugging output */
-static void fluputs(char* s)
+static void fluputs(const char* s)
{
fprintf(stderr,"%s",s);
(void) fflush(stderr);
yptimer temptick;
char* text=textlines[lineofaboff[aboff]];
char copyloc[BUFSIZ+9];
- char* tempcharp;
+ const char* tempcharp;
if(!yukopts) return;
if(globalargc!=3)
ick_lose(IE778,emitlineno,(char*)NULL);