]> andersk Git - splint.git/commitdiff
Making fixes for Microsoft Visual C++ compiler.
authorevans1629 <evans1629>
Sun, 20 Apr 2003 22:45:10 +0000 (22:45 +0000)
committerevans1629 <evans1629>
Sun, 20 Apr 2003 22:45:10 +0000 (22:45 +0000)
Moved portab.h into osd.h (and removed portab.h)
removed empty constraintOutput.c

27 files changed:
lib/standard.h
src/Headers/basic.h
src/Headers/bool.h
src/Headers/cpplib.h
src/Headers/forwardTypes.h
src/Headers/lclMisc.h
src/Headers/osd.h
src/Headers/portab.h [deleted file]
src/constraintOutput.c [deleted file]
src/cpplib.c
src/cscanner.l
src/cscannerHelp.c
src/fileTable.c
src/fileloc.c
src/flags.c
src/flags.def
src/general.c
src/help.c
src/imports.c
src/lcllib.c
src/llmain.c
src/message.c
src/osd.c
src/stateInfo.c
src/uentry.c
src/usymtab_interface.c
test/preds.expect

index f3eb80a4fb3a6e562c22a22b7aee38ee7c273a42..ee6185fc625a3fc018ba5e06659f26f01161ada7 100644 (file)
@@ -1263,18 +1263,3 @@ typedef /*@unsignedintegraltype@*/ uintmax_t;
 
 /*@constant size_t INTPTR_MIN@*/
 /*@constant size_t INTPTR_MAX@*/
-
-/*drl 3/5/2003
-  added  the __func__ identifier from C99
-  This won't follow the same semantics as
-  __func__ in C99
-
-  FWIW C99 says that __func__ should have the value of the
-  lexically enclosing function 
-  e.g. in the function foo __func__ == "foo"
-  in bar __func__ == "bar"
-
-  We're just having the value be constant here and picking
-  an arbitary value.
-*/
-const char __func__[] = "function-name";
index d6ba7ffdcbe5c7fa29472288b4586e6457e86211..5fd921a1cad34acb1e832108f64761418f357f93 100644 (file)
 
 # include <stdlib.h>
 # include <stdio.h>
+
+# ifndef WIN32
+/* Microsoft VC++ still doesn't support ISO C99... */
 # include <stdbool.h>
+# endif
+
 # include <string.h>
 # include <ctype.h>
 # include <float.h>
index fd059070c6cece156d3be3858eb3e2bd3d4daf81..d0e0be551ceafba39fe673bb0a1595b079b0a16c 100644 (file)
@@ -7,6 +7,17 @@
 
 # define BOOL_H
 
+# ifdef WIN32
+# ifndef FALSE
+/*@constant bool FALSE=false@*/
+# define FALSE 0
+# endif
+
+# ifndef TRUE
+/*@constant bool TRUE=true@*/
+# define TRUE (!FALSE)
+# endif
+# else
 # ifndef FALSE
 /*@constant bool FALSE=false@*/
 # define FALSE false
@@ -16,6 +27,7 @@
 /*@constant bool TRUE=true@*/
 # define TRUE true
 # endif
+# endif
 
 extern /*@observer@*/ cstring bool_unparse (bool p_b) /*@*/ ;
 extern /*@observer@*/ cstring bool_dump (bool p_b) /*@*/ ;
index c4778b1100b095bad6f70dcf6646e263e877e5dc..e00c063c5788eb0a1a93af8df52d782e4f78d984 100644 (file)
@@ -417,37 +417,38 @@ extern bool cppReader_isPedantic (cppReader *) /*@*/;
 /* different flavors of hash nodes --- also used in keyword table */
 enum node_type {
  T_NONE = 0,
- T_DEFINE = 1, /* the `#define' keyword */
- T_INCLUDE,    /* the `#include' keyword */
- T_INCLUDE_NEXT, /* the `#include_next' keyword */
- T_IFDEF,      /* the `#ifdef' keyword */
- T_IFNDEF,     /* the `#ifndef' keyword */
- T_IF,         /* the `#if' keyword */
- T_ELSE,       /* `#else' */
- T_PRAGMA,     /* `#pragma' */
- T_ELIF,       /* `#elif' */
- T_UNDEF,      /* `#undef' */
- T_LINE,       /* `#line' */
- T_ERROR,      /* `#error' */
- T_WARNING,    /* `#warning' */
- T_ENDIF,      /* `#endif' */
- T_IDENT,      /* `#ident', used on system V.  */
- T_SPECLINE,   /* special symbol `__LINE__' */
- T_DATE,       /* `__DATE__' */
- T_FILE,       /* `__FILE__' */
- T_BASE_FILE,  /* `__BASE_FILE__' */
- T_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */
- T_VERSION,    /* `__VERSION__' */
- T_SIZE_TYPE,   /* `__SIZE_TYPE__' */
- T_PTRDIFF_TYPE,   /* `__PTRDIFF_TYPE__' */
- T_WCHAR_TYPE,   /* `__WCHAR_TYPE__' */
- T_USER_LABEL_PREFIX_TYPE, /* `__USER_LABEL_PREFIX__' */
- T_REGISTER_PREFIX_TYPE,   /* `__REGISTER_PREFIX__' */
- T_TIME,       /* `__TIME__' */
- T_CONST,      /* Constant value, used by `__STDC__' */
- T_MACRO,      /* macro defined by `#define' */
+ T_DEFINE = 1, /* the #define keyword */
+ T_INCLUDE,    /* the #include keyword */
+ T_INCLUDE_NEXT, /* the #include_next keyword */
+ T_IFDEF,      /* the #ifdef keyword */
+ T_IFNDEF,     /* the #ifndef keyword */
+ T_IF,         /* the #if keyword */
+ T_ELSE,       /* #else */
+ T_PRAGMA,     /* #pragma */
+ T_ELIF,       /* #elif */
+ T_UNDEF,      /* #undef */
+ T_LINE,       /* #line */
+ T_ERROR,      /* #error */
+ T_WARNING,    /* #warning */
+ T_ENDIF,      /* #endif */
+ T_IDENT,      /* #ident, used on system V.  */
+ T_SPECLINE,   /* special symbol __LINE__ */
+ T_DATE,       /* __DATE__ */
+ T_FILE,       /* __FILE__ */
+ T_BASE_FILE,  /* __BASE_FILE__ */
+ T_INCLUDE_LEVEL, /* __INCLUDE_LEVEL__ */
+ T_FUNC,        /* __func__ */
+ T_VERSION,    /* __VERSION__ */
+ T_SIZE_TYPE,   /* __SIZE_TYPE__ */
+ T_PTRDIFF_TYPE,   /* __PTRDIFF_TYPE__ */
+ T_WCHAR_TYPE,   /* __WCHAR_TYPE__ */
+ T_USER_LABEL_PREFIX_TYPE, /* __USER_LABEL_PREFIX__ */
+ T_REGISTER_PREFIX_TYPE,   /* __REGISTER_PREFIX__ */
+ T_TIME,       /* __TIME__ */
+ T_CONST,      /* Constant value, used by __STDC__ */
+ T_MACRO,      /* macro defined by #define */
  T_DISABLED,   /* macro temporarily turned off for rescan */
- T_SPEC_DEFINED, /* special `defined' macro for use in #if statements */
+ T_SPEC_DEFINED, /* special defined macro for use in #if statements */
  T_PCSTRING,   /* precompiled string (hashval is KEYDEF *) */
  T_UNUSED      /* Used for something not defined.  */
 } ;
index aef68f522e7e5fb316a94e8c2f33185016802393..b55a8d25eb6496c90ae941683fb3420866ea9b64 100644 (file)
@@ -3,6 +3,11 @@
 
 # include "lclForwardTypes.h"
 
+# ifdef WIN32
+/* Microsoft doesn't support ISO C99 yet */
+typedef int bool; 
+# endif
+
 abst_typedef /*@null@*/ struct s_sRef *sRef;
 abst_typedef /*@null@*/ struct s_uentry *uentry;
 typedef struct s_hashNode *hashNode;
index 7b64163d7108718817614d6f0379d10f30840e9a..0c4ecd9ea8350824486ea2a74344b78fde834e99 100644 (file)
@@ -3,8 +3,6 @@
 
 typedef        unsigned int bits;
 typedef long unsigned Handle;
-
-extern char *FormatInt (int p_i) /*@*/ ;
 extern bool firstWord (char *p_s, char *p_w);
 
 # endif
index bf9387c0e7e00823aab16753c27b534bc1669cec..1f176b9a04274b2c7b8c9d8947c66dfabf90b7ac 100644 (file)
@@ -103,6 +103,108 @@ extern int osd_getPid (void) ;
 extern int /*pid_t*/ osd_getPid (void) ;
 # endif
 
+# ifdef WIN32
+/* Win32 doesn't support ISO C99 correctly... */
+# define snprintf _snprintf
+# endif
+
+/*
+** Win32 convention?
+*/
+
+# if defined(__IBMC__) && defined(OS2)
+# define S_IFMT (unsigned short)0xFFFF
+# endif
+
+# if defined (OS2) || defined (MSDOS) || defined (WIN32)
+/*@constant observer cstring INCLUDEPATH_VAR@*/
+# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("INCLUDE")
+# else
+/*@constant observer cstring INCLUDEPATH_VAR@*/
+# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("CPATH")
+# endif
+
+#if defined (VMS)
+
+/*
+** VMS is here, but hasn't been tested for many releases.  Not sure if this works.
+*/
+
+/*
+** Connection string inserted between directory and filename to make a  
+** full path name.                                                     
+*/
+
+# define    CONNECTSTR ":"
+# define    CONNECTCHAR        ':'
+
+/* Directory separator character for search list. */
+/*@constant static char PATH_SEPARATOR; @*/
+# define PATH_SEPARATOR ':'
+
+# elif defined(MSDOS) || defined(OS2) || defined(WIN32)
+
+/* Connection string inserted between directory and filename to make a  */
+/* full path name.                                                     */
+
+/*@constant observer char *CONNECTSTR@*/
+# define CONNECTSTR    "\\"
+
+/*@constant char CONNECTCHAR@*/
+# define CONNECTCHAR   '\\'
+
+# define HASALTCONNECTCHAR
+
+/*@constant char ALTCONNECTCHAR@*/
+# define ALTCONNECTCHAR '/'
+
+/* Directory separator character for search list. */
+
+/*@constant char PATH_SEPARATOR; @*/
+# define PATH_SEPARATOR ';'
+
+#else
+/* Connection string inserted between directory and filename to make a  */
+/* full path name.                                                     */
+
+/*@constant observer char *CONNECTSTR@*/
+# define CONNECTSTR    "/"
+
+/*@constant char CONNECTCHAR; @*/
+# define CONNECTCHAR   '/'
+
+/* Directory separator character for search list. */
+/*@constant char PATH_SEPARATOR; @*/
+# define PATH_SEPARATOR ':'
+
+#endif
+
+
+# ifdef P_tmpdir
+
+# if defined(OS2) && defined(__IBMC__)
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR "."
+# else
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR P_tmpdir
+# endif
+# else
+# ifdef WIN32
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR "\\WINDOWS\\TEMP\\"
+# else
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR "/tmp/"
+# endif /* WIN32 */
+
+# endif /* P_tmpdir */
+
+# else
+# error "Multiple include"
+# endif
+
+
 # else
 # error "Multiple include"
 # endif
diff --git a/src/Headers/portab.h b/src/Headers/portab.h
deleted file mode 100644 (file)
index 2b1a936..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-** Copyright (c) Massachusetts Institute of Technology 1994, 1995, 1996.
-** See ../LICENSE for license information.
-*/
-
-# ifndef PORTAB_H
-# define PORTAB_H
-
-/*
-** Win32 convention?
-*/
-
-# if defined(__IBMC__) && defined(OS2)
-# define S_IFMT (unsigned short)0xFFFF
-# endif
-
-# if defined (OS2) || defined (MSDOS) || defined (WIN32)
-/*@constant observer cstring INCLUDEPATH_VAR@*/
-# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("INCLUDE")
-# else
-/*@constant observer cstring INCLUDEPATH_VAR@*/
-# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("CPATH")
-# endif
-
-#if defined (VMS)
-
-/*
-** VMS is here, but hasn't been tested for many releases.  Not sure if this works.
-*/
-
-/*
-** Connection string inserted between directory and filename to make a  
-** full path name.                                                     
-*/
-
-# define    CONNECTSTR ":"
-# define    CONNECTCHAR        ':'
-
-/* Directory separator character for search list. */
-/*@constant static char PATH_SEPARATOR; @*/
-# define PATH_SEPARATOR ':'
-
-# elif defined(MSDOS) || defined(OS2) || defined(WIN32)
-
-/* Connection string inserted between directory and filename to make a  */
-/* full path name.                                                     */
-
-/*@constant observer char *CONNECTSTR@*/
-# define CONNECTSTR    "\\"
-
-/*@constant char CONNECTCHAR@*/
-# define CONNECTCHAR   '\\'
-
-# define HASALTCONNECTCHAR
-
-/*@constant char ALTCONNECTCHAR@*/
-# define ALTCONNECTCHAR '/'
-
-/* Directory separator character for search list. */
-
-/*@constant char PATH_SEPARATOR; @*/
-# define PATH_SEPARATOR ';'
-
-#else
-/* Connection string inserted between directory and filename to make a  */
-/* full path name.                                                     */
-
-/*@constant observer char *CONNECTSTR@*/
-# define CONNECTSTR    "/"
-
-/*@constant char CONNECTCHAR; @*/
-# define CONNECTCHAR   '/'
-
-/* Directory separator character for search list. */
-/*@constant char PATH_SEPARATOR; @*/
-# define PATH_SEPARATOR ':'
-
-#endif
-
-
-# ifdef P_tmpdir
-
-# if defined(OS2) && defined(__IBMC__)
-/*@constant observer char *DEFAULT_TMPDIR; @*/
-# define DEFAULT_TMPDIR "."
-# else
-/*@constant observer char *DEFAULT_TMPDIR; @*/
-# define DEFAULT_TMPDIR P_tmpdir
-# endif
-# else
-# ifdef WIN32
-/*@constant observer char *DEFAULT_TMPDIR; @*/
-# define DEFAULT_TMPDIR "\\WINDOWS\\TEMP\\"
-# else
-/*@constant observer char *DEFAULT_TMPDIR; @*/
-# define DEFAULT_TMPDIR "/tmp/"
-# endif /* WIN32 */
-
-# endif /* P_tmpdir */
-
-# else
-# error "Multiple include"
-# endif
-
diff --git a/src/constraintOutput.c b/src/constraintOutput.c
deleted file mode 100644 (file)
index 1b3ab26..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2003 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on splint: info@splint.org
-** To report a bug: splint-bug@splint.org
-** For more information: http://www.splint.org
-*/
-
-/*
-** constraintOutput.c
-*/
-
-# include "splintMacros.nf"
-# include "basic.h"
-# include "portab.h"
-
-
-
index 40ac023b668adcca2b2b9fb48988bc48c42f0d7c..d1534ad455e0fd0379e0670e4e4f5938abc20a33 100644 (file)
@@ -3461,6 +3461,14 @@ special_symbol (hashNode hp, cppReader *pfile)
        quote_string (pfile, string);
        return;
       }
+    case T_FUNC: /* added in ISO C99 */
+      {
+       /* We don't know the actual name of the function, but it doesn't matter */
+       char *string = "** function-name **";
+       cpplib_reserve (pfile, 3 + 4 * strlen (string));
+       quote_string (pfile, string);
+       return;
+      }
 
     case T_INCLUDE_LEVEL:
       true_indepth = 0;
@@ -3698,6 +3706,7 @@ initialize_builtins (cppReader *pfile)
   cpplib_installBuiltin ("__DATE__", ctype_string, -1, T_DATE, 0, NULL, -1);
   cpplib_installBuiltin ("__FILE__", ctype_string, -1, T_FILE, 0, NULL, -1);
   cpplib_installBuiltin ("__BASE_FILE__", ctype_string, -1, T_BASE_FILE, 0, NULL, -1);
+  cpplib_installBuiltin ("__func__", ctype_string, -1, T_FUNC, 0, NULL, -1);
   cpplib_installBuiltin ("__INCLUDE_LEVEL__", ctype_int, -1, T_INCLUDE_LEVEL, 0, NULL, -1);
   cpplib_installBuiltin ("__VERSION__", ctype_string, -1, T_VERSION, 0, NULL, -1);
 #ifndef NO_BUILTIN_SIZE_TYPE
index 625126dbbd016d7762ea326e106f488a3216ffc2..3b2befb68a38588f7f61c0901d8976ca2f9a939a 100644 (file)
@@ -85,7 +85,7 @@ ULSuffix                ({U}{L}|{L}{U})
 # include "cscannerHelp.h"
 # include "cgrammar.h"
 # include "cgrammar_tokens.h"
-# include "portab.h"
+# include "osd.h"
 
 /*@notfunction@*/
 # define yyinput() (incColumn (), getc (yyin))
index ece76d9b321f172c55092714ec5363f3d66cc0c0..3d325d2021c4659575440af931a848c24a178c0d 100644 (file)
@@ -33,6 +33,7 @@
 # include "cscannerHelp.h"
 # include "cscanner.h"
 # include "cgrammar_tokens.h"
+# include "portab.h"
 
 static int lminput (void);
 static int s_tokLength = 0;
index 46722ba0b422dc6e9e7c4fea1ca52ba00fd7520e..ffec6d2530f2585641b2cc238e40cfc264114a43 100644 (file)
@@ -53,6 +53,9 @@
 # include "llmain.h"
 # include "portab.h"
 
+# ifdef WIN32
+# include <io.h>
+# else
 # if defined(__IBMC__) && defined(OS2)
 # include <process.h>
 # include <io.h>
@@ -61,6 +64,7 @@
 # define S_IWUSR S_IWRITE 
 # define S_IXUSR S_IEXEC
 # endif
+# endif
 
 /*@access fileId*/
 
@@ -1012,9 +1016,13 @@ fileTable_addOpen (fileTable ft, /*@observer@*/ FILE *f, /*@only@*/ cstring fnam
 FILE *fileTable_createFile (fileTable ft, cstring fname)
 {
 # ifdef WIN32
-   int fdesc = open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL); /* not supported by VS.net: , S_IRUSR | S_IWUSR); */
+  int fdesc = _open (cstring_toCharsSafe (fname), 
+                    O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 
+                    _S_IWRITE | S_IREAD);
 # else
-   int fdesc = open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR);
+   int fdesc = open (cstring_toCharsSafe (fname), 
+                    O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
+                    S_IRUSR | S_IWUSR);
 # endif
 
   if (fdesc == -1)
@@ -1047,7 +1055,15 @@ FILE *fileTable_createFile (fileTable ft, cstring fname)
 
 FILE *fileTable_createMacrosFile (fileTable ft, cstring fname)
 {
-  int fdesc = open (cstring_toCharsSafe (fname), O_RDWR | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR);
+# ifdef WIN32
+  int fdesc = _open (cstring_toCharsSafe (fname), 
+                    O_RDWR | O_CREAT | O_TRUNC | O_EXCL,
+                    _S_IREAD | _S_IWRITE);
+# else
+  int fdesc = open (cstring_toCharsSafe (fname), 
+                   O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 
+                   S_IRUSR | S_IWUSR);
+# endif
 
   if (fdesc == -1)
     {
index ad82ba5551a3cb196bd88b275d9c2813a7f7ce68..461659bac6e8867773476dd35612fa9dc29edf61 100644 (file)
@@ -26,7 +26,7 @@
 */
 /*
  * Modified by Herbert 04/19/97:
- * - added new include file portab.h.
+ * - added new include file portab.h (now in osd.h)
  * - added new private function fileloc_filenameForCpp() to handle
  *   filenames belonging to "#line" statements for OS/2 and MSDOS. It
  *   gets called by fileloc_lineMarker() and fileloc_previousLineMarker()
@@ -36,7 +36,6 @@
 # include "splintMacros.nf"
 # include "basic.h"
 # include "osd.h"
-# include "portab.h"
 
 static /*@only@*/ fileloc fileloc_createPrim (flkind p_kind, fileId p_fid, int p_line, int p_col) /*@*/ ;
 
index e8b3ceb00f6f8decc50e6550627a3dad85f9cf07..b9874fe18e1290c8f01b07f45262effbeaaeb334 100644 (file)
@@ -31,6 +31,7 @@
 # include "portab.h"
 # include "rcfiles.h"
 # include "lslinit.h"
+# include "llmain.h"
 
 /*
 ** from the CC man page:
@@ -145,12 +146,12 @@ static /*@observer@*/ cstring argcode_unparse (argcode arg)
     }
 # ifdef WIN32
 /* Make Microsoft VC++ happy */
-# pragma warning (disable:4715) 
+# pragma warning (disable:4715)
 # endif
 }      
 
 # ifdef WIN32
-# pragma warning (enable:4715) 
+/* # pragma warning (enable:4715)  */
 # endif
 
 typedef struct { 
index 404b0c2ee9194ce593d0ad25454433699f2a6ce1..a41648d4b64209f61ad13f8a52cdd17adca65692 100644 (file)
@@ -381,14 +381,14 @@ static flaglist flags =
     FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
     "boolfalse",
     FLG_BOOLFALSE,
-    "set name of boolean false (default FALSE)",
+    "set name of boolean false (default false)",
     NULL, 0, 0
   },
   {
     FK_BOOL, FK_NONE, regStringFlag, ARG_STRING,
     "booltrue",
     FLG_BOOLTRUE, 
-    "set name of boolean true (default TRUE)",
+    "set name of boolean true (default true)",
     NULL, 0, 0
   },
   {
@@ -406,10 +406,10 @@ static flaglist flags =
     FK_BOOL, FK_OPS, modeFlag,
     "boolcompare",
     FLG_BOOLCOMPARE,
-    "comparison between bools (dangerous because of multiple TRUE values)",
+    "comparison between bools (dangerous because of multiple true values)",
     "Two bool values are compared directly using a C primitive. This "
     "may produce unexpected results since all non-zero values are "
-    "considered TRUE, so different TRUE values may not be equal. "
+    "considered true, so different true values may not be equal. "
     "The file bool.h (included in splint/lib) provides bool_equal "
     "for safe bool comparisons.", 0, 0
   },
index 972420079cde04b7be3ae3f554c2fbc149469108..da2bb57ef3b8a263d1d9bbfacc3276a23b971531 100644 (file)
@@ -27,6 +27,7 @@
 
 # include "splintMacros.nf"
 # include "basic.h"
+
 # undef malloc
 # undef realloc
 # undef calloc
@@ -35,7 +36,7 @@
 # include "dmalloc.h"
 # endif
 
-# include "portab.h"
+# include "osd.h"
 
 /*
 ** redefine undef'd memory ops
@@ -187,18 +188,6 @@ void *direalloc (/*@out@*/ /*@null@*/ void *x, size_t size,
 
 /*@=mustdefine@*/
 
-char *FormatInt (int i)
-{
-  char temp[255]; /* assume the integer has at most 254 digits */
-  char *outs;
-  int sres = snprintf (temp, 255, "%i", i);
-  check (sres >= 0 && sres <= 255);
-  outs = (char *) dmalloc (sizeof (*outs) * (1 + strlen (temp)));
-  strcpy (outs, temp);
-
-  return (outs);
-}
-
 bool firstWord (char *s, char *w)
 {
   llassert (s != NULL);
index eee5ffbf894ca1bcdd2e33d924a616bbeff81661..c467995323ef00b231c32d5488cf8c09e9eae548 100644 (file)
@@ -30,6 +30,7 @@
 # include "help.h"
 # include "osd.h"
 # include "portab.h"
+# include "llmain.h"
 # include "version.h"
 
 static void
index c6c4441ec5de19af3fe693e312733f902057d2a7..9af14d90290170ed4ee581d3fb874fc720e05da1 100644 (file)
@@ -41,7 +41,6 @@
 # include "lslparse.h"
 # include "lh.h"
 # include "llmain.h"
-# include "portab.h"
 
 void
 outputLCSFile (char *path, char *msg, char *specname)
index 300ab7aa69d9e8044fa0c7c9e981b34392ff0bdd..205cbe44e233efd4ddbdf4599b1b028da5cdd61a 100644 (file)
@@ -46,7 +46,6 @@
 
 # include "lcllib.h"
 # include "llmain.h"
-# include "portab.h"
 
 /*@-incondefs@*/ /*@-redecl@*/
 extern /*:open:*/ /*@dependent@*/ FILE *yyin;
index 5a389160ab56cebfec5716662427a61ccbfa95b8..739fc96f74a17ba7560c7142a184edcfb2ba28d7 100644 (file)
@@ -52,7 +52,6 @@
 # include "basic.h"
 # include "osd.h"
 # include "help.h"
-
 # include "gram.h"
 # include "lclscan.h"
 # include "scanline.h"
@@ -71,9 +70,8 @@
 # include "Headers/version.h" /* Visual C++ finds the wrong version.h */
 # include "lcllib.h"
 # include "cgrammar.h"
+# include "rcfiles.h"
 # include "llmain.h"
-# include "portab.h"
-
 
 extern /*@external@*/ int yydebug;
 static void cleanupFiles (void);
index 1c9c2313fe57965954a5e50e2177653e1ed6c653..55129890f9a665e46f8170952097d2c0003412a3 100644 (file)
@@ -246,8 +246,10 @@ message (/*@temp@*/ char *fmt, ...)
              ret = mstring_concatFree (ret, GETPRINTF ("%.2lf", va_arg (pvar, double)));
              break;
            case XBOOL:
-             ret = mstring_concatFree1 (ret, cstring_toCharsSafe 
-                                   (bool_unparse (va_arg (pvar, bool))));
+             ret = mstring_concatFree1 
+               (ret, cstring_toCharsSafe 
+                (bool_unparse (bool_fromInt ((va_arg (pvar, int)))))); 
+             /* va_arg should not use bool type */
              break;
            case XUENTRY:
              ret = mstring_concatFree (ret, cstring_toCharsSafe 
index da780fc69f690c0112ffa65952fe9f6cb5752bab..b429d3f30b37c0785df7c81c5dec6a9c0730ef46 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -62,7 +62,6 @@
 # include "splintMacros.nf"
 # include "basic.h"
 # include "osd.h"
-# include "portab.h"
 
 /* from stat.h */
 /*@ignore@*/
index 79e0049f7a9813172fa3b6b4c186c95df7e951f1..6d80a88a87d359d297309e860e3837caa40525cc 100644 (file)
 # include "splintMacros.nf"
 # include "basic.h"
 
+# ifdef WIN32
+/*
+** Make Microsoft VC++ happy: its control checking produces too
+** many spurious warnings.
+*/
+
+# pragma warning (disable:4715) 
+# endif
+
 static /*@observer@*/ cstring stateAction_unparse (stateAction p_sa) /*@*/ ;
 
 void stateInfo_free (/*@only@*/ stateInfo a)
index 6d364fb20d59258541c47a18011700b00d5d09fe..d951a302a13e10d8083c8fbbefe74b04224dd2c7 100644 (file)
@@ -5801,19 +5801,14 @@ uentry_getMods (uentry l)
     }
 # ifdef WIN32
 /* Make Microsoft VC++ happy */
-# pragma warning (disable:4715) 
+# pragma warning (disable : 4715) 
 # endif
 }
 
-# ifdef WIN32
-# pragma warning (enable:4715) 
-# endif
-
 ekind
 uentry_getKind (uentry e)
 {
   llassert (uentry_isValid (e));
-
   return (e->ukind);
 }
 
index f55a38822d0076d184c285c7e93da17d7df28584..a8ac1257a64d3f0ddbe6d8ffe0e8683ce1f6dd3e 100644 (file)
@@ -1012,8 +1012,8 @@ doDeclareType (typeNode t, bool priv)
        case TK_UNION:
        default:
          {
-           llfatalbug (message ("declareType ERROR: unknown kind: %q",
-                                cstring_fromCharsO (FormatInt ((int)t->kind))));
+           llfatalbug (message ("declareType: unknown kind: %d",
+                                (int) t->kind));
          }
        }
     }
index 9a8315d534e278d6c4e7e2e5fcbacd3e485f5e27..a1f1576f7a1461e65107721b141b8d5626a86c65 100644 (file)
@@ -16,8 +16,8 @@ preds.c:25:7: Test expression for if not bool, type char: (c = 'a')
 preds.c:30:7: Use of == with bool variables (risks inconsistency because of
                  multiple true values): b1 == b2
   Two bool values are compared directly using a C primitive. This may produce
-  unexpected results since all non-zero values are considered TRUE, so
-  different TRUE values may not be equal. The file bool.h (included in
+  unexpected results since all non-zero values are considered true, so
+  different true values may not be equal. The file bool.h (included in
   splint/lib) provides bool_equal for safe bool comparisons. (Use -boolcompare
   to inhibit warning)
 preds.c:35:7: Test expression for if not bool, type char: c
@@ -56,8 +56,8 @@ preds.c:25:7: Test expression for if not bool, type char: (c = 'a')
 preds.c:30:7: Use of == with bool variables (risks inconsistency because of
                  multiple true values): b1 == b2
   Two bool values are compared directly using a C primitive. This may produce
-  unexpected results since all non-zero values are considered TRUE, so
-  different TRUE values may not be equal. The file bool.h (included in
+  unexpected results since all non-zero values are considered true, so
+  different true values may not be equal. The file bool.h (included in
   splint/lib) provides bool_equal for safe bool comparisons. (Use -boolcompare
   to inhibit warning)
 preds.c:35:7: Test expression for if not bool, type char: c
This page took 0.109698 seconds and 5 git commands to generate.