/* Splint's imports directory */
#define DEFAULT_LCLIMPORTDIR ".:/usr/local/share/splint/imports:/af10/evans/LCLintDev/imports"
-/* gcc's private include directory */
-#define GCC_INCLUDE_DIR "/usr/lib/gcc-lib/i386-linux/2.7.2.1/include"
+/* system include directory */
+#define GCC_INCLUDE_DIR "/usr/include"
-/* the system's main include directory */
+/* alternate include directory */
#define GCC_INCLUDE_DIR2 "/usr/local/include"
/* String describing who compiled this binary and how */
/* Splint's version number */
#define LCL_PARSE_VERSION "Splint 3.0.0.20"
-/* Splint's version number and release date */
-#define LCL_VERSION "Splint 3.0.0.20 --- 5 October 2001"
-
/* Define to disable support LCL files */
/* #undef NOLCL */
+/* Splint's version number and release date */
+#define SPLINT_VERSION "Splint 3.0.0.20 --- 29 December 2001"
+
/* The system's main include directory */
#define SYSTEM_LIBDIR "/usr/local/include"
/* Splint's imports directory */
#undef DEFAULT_LCLIMPORTDIR
-/* gcc's private include directory */
+/* system include directory */
#undef GCC_INCLUDE_DIR
-/* the system's main include directory */
+/* alternate include directory */
#undef GCC_INCLUDE_DIR2
/* String describing who compiled this binary and how */
/* Splint's version number */
#undef LCL_PARSE_VERSION
-/* Splint's version number and release date */
-#undef LCL_VERSION
-
/* Define to disable support LCL files */
#undef NOLCL
+/* Splint's version number and release date */
+#undef SPLINT_VERSION
+
/* The system's main include directory */
#undef SYSTEM_LIBDIR
# This breaks on gcc-3.0 on redhat fixing drl 11-15-2001
# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/'`
- GCC_INCLUDE_DIR=/usr/lib/gcc-lib/i386-linux/2.7.2.1/include
+GCC_INCLUDE_DIR=/usr/include
+# was /usr/lib/gcc-lib/i386-linux/2.7.2.1/include
# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -n -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/p'`
cat >>confdefs.h <<EOF
LCL_PARSE_VERSION="Splint 3.0.0.20"
cat >>confdefs.h <<EOF
-#define LCL_VERSION "$LCL_PARSE_VERSION --- `cat $srcdir/src/DATE`"
+#define SPLINT_VERSION "$LCL_PARSE_VERSION --- `cat $srcdir/src/DATE`"
EOF
cat >>confdefs.h <<EOF
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:3080: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:3081: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:3256: error: ambiguous option: $1
+ { { echo "$as_me:3257: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:3275: error: unrecognized option: $1
+ -*) { { echo "$as_me:3276: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
"test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
"default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
- *) { { echo "$as_me:3327: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:3328: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:3573: creating $ac_file" >&5
+ { echo "$as_me:3574: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:3591: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:3592: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:3604: error: cannot find input file: $f" >&5
+ { { echo "$as_me:3605: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
* ) ac_file_in=$ac_file.in ;;
esac
- test x"$ac_file" != x- && { echo "$as_me:3665: creating $ac_file" >&5
+ test x"$ac_file" != x- && { echo "$as_me:3666: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:3676: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:3677: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:3689: error: cannot find input file: $f" >&5
+ { { echo "$as_me:3690: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
- { echo "$as_me:3806: $ac_file is unchanged" >&5
+ { echo "$as_me:3807: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
# This breaks on gcc-3.0 on redhat fixing drl 11-15-2001
# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/'`
- GCC_INCLUDE_DIR=/usr/lib/gcc-lib/i386-linux/2.7.2.1/include
+GCC_INCLUDE_DIR=/usr/include
+# was /usr/lib/gcc-lib/i386-linux/2.7.2.1/include
# GCC_INCLUDE_DIR=`LANGUAGE= LANG= $CC -v 2>&1 | sed -n -e '/^gcc/ d' -e 's/.* \(.*\)specs/\1include/p'`
AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR",
- [gcc's private include directory])
+ [system include directory])
fi
AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR2, "$myprefix/include",
- [the system's main include directory])
+ [alternate include directory])
# These used to be in local_constants.h
AC_DEFINE_UNQUOTED(SYSTEM_LIBDIR, "$myprefix/include",
# These used to be in herald.h
LCL_PARSE_VERSION="AC_PACKAGE_NAME AC_PACKAGE_VERSION"
-AC_DEFINE_UNQUOTED(LCL_VERSION,
+AC_DEFINE_UNQUOTED(SPLINT_VERSION,
"$LCL_PARSE_VERSION --- `cat $srcdir/src/DATE`",
[Splint's version number and release date])
AC_DEFINE_UNQUOTED(LCL_PARSE_VERSION, "$LCL_PARSE_VERSION",
extern bool osd_fileIsReadable (cstring);
extern bool osd_isConnectChar (char) /*@*/ ;
+extern /*@observer@*/ cstring osd_getCurrentDirectory (void) /*@*/ ;
# ifdef WIN32
extern int osd_getPid (void) ;
cstring abspath;
if (ft == NULL) return NOT_FOUND;
abspath = osd_absolutePath (cstring_undefined, s);
+ DPRINTF (("Absolute path: %s: %s", s, abspath));
res = cstringTable_lookup (ft->htable, abspath);
cstring_free (abspath);
return res;
ft->nspace--;
+ DPRINTF (("Adding: %s", e->fname));
cstringTable_insert (ft->htable, e->fname, ft->nentries);
ft->elements[ft->nentries] = e;
int tindex = fileTable_getIndex (ft, s);
if (tindex == NOT_FOUND)
- return FALSE;
+ {
+ DPRINTF (("Not found: %s", s));
+ return FALSE;
+ }
else
- return TRUE;
+ {
+ return TRUE;
+ }
}
fileId
void prepareMessage (void)
{
DPRINTF (("Prepare message: %s", bool_unparse (context_loadingLibrary ())));
+ showHerald ();
if ((context_isPreprocessing () || context_loadingLibrary ())
&& s_needsPrepare
static void showHelp (void);
static void interrupt (int p_i);
+static bool readOptionsFile (cstring p_fname,
+ cstringSList *p_passThroughArgs,
+ bool p_report)
+ /*@modifies fileSystem, internalState, *p_passThroughArgs@*/ ;
+
static void loadrc (FILE *p_rcfile, cstringSList *p_passThroughArgs)
- /*@ensures closed p_rcfile@*/ ;
+ /*@modifies *p_passThroughArgs@*/
+ /*@ensures closed p_rcfile@*/ ;
static void describeVars (void);
static bool specialFlagsHelp (char *p_next);
if (*thisarg == '-' || *thisarg == '+')
{
+ bool set = (*thisarg == '+');
+ flagcode opt;
+
thisarg++;
+ opt = identifyFlag (cstring_fromChars (thisarg));
- if (mstring_equal (thisarg, "nof"))
+ if (opt == FLG_NOF)
{
nof = TRUE;
}
- else if (mstring_equal (thisarg, "f"))
+ else if (opt == FLG_SHOWSCAN || opt == FLG_WARNRC)
+ {
+ /*
+ ** Need to set it immediately, so rc file scan is displayed
+ */
+
+ context_userSetFlag (opt, set);
+ }
+ else if (opt == FLG_OPTF)
{
if (++i < argc)
{
defaultf = FALSE;
fname = cstring_fromChars (argv[i]);
- rcfile = fileTable_openFile (context_fileTable (), fname, "r");
-
- if (rcfile != NULL)
- {
- fileloc oloc = g_currentloc;
-
- g_currentloc = fileloc_createRc (cstring_fromChars (fname));
- loadrc (rcfile, &passThroughArgs);
- fileloc_reallyFree (g_currentloc);
- g_currentloc = oloc;
- }
- else
- {
- showHerald ();
- lldiagmsg (message ("Options file not found: %s", fname));
- }
+ readOptionsFile (fname, &passThroughArgs, TRUE);
}
else
llfatalerror
}
}
}
-
- if (cstring_isUndefined (fname))
- {
- if (!cstring_isEmpty (home)) {
- fname = message ("%s%h%s", home, CONNECTCHAR,
- cstring_fromChars (RCFILE));
- cstring_markOwned (fname);
- }
- }
-
+
setCodePoint ();
if (!nof && defaultf)
{
- if (!cstring_isEmpty (fname))
- {
- rcfile = fileTable_openFile (context_fileTable (), fname, "r");
-
- if (rcfile != NULL)
- {
- fileloc oloc = g_currentloc;
-
- g_currentloc = fileloc_createRc (fname);
- loadrc (rcfile, &passThroughArgs);
- fileloc_reallyFree (g_currentloc);
- g_currentloc = oloc;
- }
- }
-
-# if defined(MSDOS) || defined(OS2)
- fname = message ("%s",cstring_fromChars (RCFILE));
-# else
- fname = message ("./%s", cstring_fromChars (RCFILE));
-# endif
-
- rcfile = fileTable_openFile (context_fileTable (), fname, "r");
-
/*
- ** If no RCFILE, try ALTRCFILE
+ ** No explicit rc file, first try reading ~/.splintrc
*/
- if (rcfile == NULL)
- {
- cstring_free (fname);
-# if defined(MSDOS) || defined(OS2)
- fname = message ("%s", cstring_fromChars (ALTRCFILE));
-# else
- fname = message ("./%s", cstring_fromChars (ALTRCFILE));
-# endif
- rcfile = fileTable_openFile (context_fileTable (), fname, "r");
- }
- else
+ if (cstring_isUndefined (fname))
{
- /*
- ** Warn if ALTRCFILE also exists
- */
- cstring afname;
- FILE *arcfile;
-
-# if defined(MSDOS) || defined(OS2)
- afname = message ("%s", cstring_fromChars (ALTRCFILE));
-# else
- afname = message ("./%s", cstring_fromChars (ALTRCFILE));
-# endif
- arcfile = fileTable_openFile (context_fileTable (), afname, "r");
-
- if (arcfile != NULL)
+ if (!cstring_isEmpty (home))
{
- voptgenerror (FLG_WARNRC,
- message ("Found both %s and %s files. Using %s file only.",
- fname, afname, fname),
- g_currentloc);
+ bool readhomerc, readaltrc;
+ cstring homename, altname;
+
+ homename = message ("%s%h%s", home, CONNECTCHAR,
+ cstring_fromChars (RCFILE));
+ readhomerc = readOptionsFile (homename, &passThroughArgs, FALSE);
- fileTable_closeFile (context_fileTable (), arcfile);
+ /*
+ ** Try ~/.lclintrc also for historical accuracy
+ */
+
+ altname = message ("%s%h%s", home, CONNECTCHAR,
+ cstring_fromChars (ALTRCFILE));
+ readaltrc = readOptionsFile (altname, &passThroughArgs, FALSE);
+
+ if (readhomerc && readaltrc)
+ {
+
+ voptgenerror
+ (FLG_WARNRC,
+ message ("Found both %s and %s files. Using both files, "
+ "but recommend using only %s to avoid confusion.",
+ homename, altname, homename),
+ g_currentloc);
+ }
}
}
- if (rcfile != NULL)
- {
- fileloc oloc = g_currentloc;
-
- g_currentloc = fileloc_createRc (cstring_fromChars (fname));
- loadrc (rcfile, &passThroughArgs);
- fileloc_reallyFree (g_currentloc);
- g_currentloc = oloc;
- }
+ /*
+ ** Next, read .splintrc in the current working directory
+ */
+
+ {
+ cstring rcname = message ("%s%s",osd_getCurrentDirectory (), cstring_fromChars (RCFILE));
+ cstring altname = message ("%s%s",osd_getCurrentDirectory (), cstring_fromChars (ALTRCFILE));
+ bool readrc, readaltrc;
+
+ readrc = readOptionsFile (rcname, &passThroughArgs, FALSE);
+ readaltrc = readOptionsFile (altname, &passThroughArgs, FALSE);
+
+ if (readrc && readaltrc)
+ {
+ voptgenerror (FLG_WARNRC,
+ message ("Found both %s and %s files. Using both files, "
+ "but recommend using only %s to avoid confusion.",
+ rcname, altname, rcname),
+ g_currentloc);
+
+ }
- sfree (fname);
+ cstring_free (rcname);
+ cstring_free (altname);
+ }
}
}
opt = identifyFlag (flagname);
DPRINTF (("Flag: %s", flagcode_unparse (opt)));
- if (flagcode_isSkip (opt))
+ if (flagcode_isSkip (opt) || opt == FLG_SHOWSCAN || opt == FLG_WARNRC)
{
+ /* showscan already processed */
DPRINTF (("Skipping!"));
}
else if (flagcode_isInvalid (opt))
}
setCodePoint ();
-
+ showHerald ();
+
/*
** create lists of C and LCL files
*/
}
} end_cstringSList_elements;
- showHerald (); /*@i723 move earlier? */
-
if (showhelp)
{
if (allhelp)
exit ((status == LLSUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE);
}
+bool readOptionsFile (cstring fname, cstringSList *passThroughArgs, bool report)
+{
+ bool res = FALSE;
+
+ if (fileTable_exists (context_fileTable (), fname))
+ {
+ if (report)
+ {
+ voptgenerror
+ (FLG_WARNRC,
+ message ("Multiple attempts to read options file: %s", fname),
+ g_currentloc);
+ }
+ }
+ else
+ {
+ FILE *innerf = fileTable_openFile (context_fileTable (), fname, "r");
+
+ if (innerf != NULL)
+ {
+ fileloc fc = g_currentloc;
+ g_currentloc = fileloc_createRc (fname);
+
+ if (context_getFlag (FLG_SHOWSCAN))
+ {
+ lldiagmsg (message ("< reading options from %s >",
+ fileloc_outputFilename (g_currentloc)));
+ }
+
+ loadrc (innerf, passThroughArgs);
+ fileloc_reallyFree (g_currentloc);
+ g_currentloc = fc;
+ res = TRUE;
+ }
+ else
+ {
+ if (report)
+ {
+ voptgenerror
+ (FLG_WARNRC,
+ message ("Cannot open options file: %s", fname),
+ g_currentloc);
+ }
+ }
+ }
+
+ return res;
+}
+
/*
** This shouldn't be necessary, but Apple Darwin can't handle '"''s.
*/
{
char *s = mstring_create (MAX_LINE_LENGTH);
char *os = s;
-
+
DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
s = os;
}
else if (opt == FLG_OPTF)
{
- FILE *innerf = fileTable_openFile (context_fileTable (), extra, "r");
- cstring_markOwned (extra);
-
- if (innerf != NULL)
- {
- fileloc fc = g_currentloc;
- g_currentloc = fileloc_createRc (extra);
- loadrc (innerf, passThroughArgs);
- fileloc_reallyFree (g_currentloc);
- g_currentloc = fc;
- }
- else
- {
- showHerald ();
- voptgenerror
- (FLG_BADFLAG,
- message ("Options file not found: %s",
- extra),
- g_currentloc);
- }
+ (void) readOptionsFile (extra, passThroughArgs, TRUE);
}
else if (opt == FLG_INIT)
{
# endif
}
+cstring osd_getCurrentDirectory ()
+{
+# if defined(MSDOS) || defined(OS2)
+ return cstring_makeLiteralTemp ("");
+# else
+ return cstring_makeLiteralTemp ("./");
+# endif
+}
+
static void uentry_checkIterArgs (uentry p_ue);
static cstring uentry_dumpAux (uentry p_v, bool p_isParam);
+static void uentry_showWhereLastKind (uentry p_spec) /*@*/ ;
+
static void uentry_combineModifies (uentry p_ue, /*@owned@*/ sRefSet p_sr)
/*@modifies p_ue@*/ ;
uentry_getName (unew),
ekind_unparseLong (unew->ukind),
unew->utype),
- uentry_whereDeclared (unew)))
+ uentry_whereLast (unew))) /* evans 2001-12-30: was uentry_whereDeclared */
{
- uentry_showWhereLast (old);
+ uentry_showWhereLastKind (old);
}
}
else
uentry_getName (unew),
ekind_unparseLong (unew->ukind),
unew->utype),
- uentry_whereDeclared (unew)))
+ uentry_whereLast (unew))) /* evans 2001-12-30: was uentry_whereDeclared */
{
- uentry_showWhereLast (old);
+ uentry_showWhereLastKind (old);
}
}
}
{
llassert (uentry_isDeclared (unew));
+ DPRINTF (("Old: \n\t%s", uentry_unparseFull (old)));
+ DPRINTF (("New: \n\t%s", uentry_unparseFull (unew)));
+
if (optgenerror
(FLG_INCONDEFS,
message ("%s %q inconsistently redeclared as %s",
ekind_capName (old->ukind),
uentry_getName (unew),
ekind_unparseLong (unew->ukind)),
- uentry_whereDeclared (unew)))
+ uentry_whereLast (unew))) /* evans 2001-12-30: was uentry_whereDeclared */
{
- uentry_showWhereLast (old);
+ uentry_showWhereLastKind (old);
}
}
}
{
if (fileloc_isDefined (spec->whereDefined)
&& !fileloc_isLib (spec->whereDefined)
- && !fileloc_isPreproc (spec->whereDefined))
+ /*!! && !fileloc_isPreproc (spec->whereDefined) */ )
{
llgenindentmsg (message ("Previous definition of %q: %t",
uentry_getName (spec),
}
}
+static void
+uentry_showWhereLastKind (uentry spec)
+{
+ if (uentry_isValid (spec))
+ {
+ if (fileloc_isDefined (spec->whereDefined)
+ && !fileloc_isLib (spec->whereDefined)
+ /*!! && !fileloc_isPreproc (spec->whereDefined) */ )
+ {
+ llgenindentmsg (message ("Previous definition of %q as %s: %t",
+ uentry_getName (spec),
+ ekind_unparseLong (spec->ukind),
+ uentry_getType (spec)),
+ uentry_whereDefined (spec));
+ }
+ else if (uentry_isDeclared (spec))
+ {
+ llgenindentmsg (message ("Previous declaration of %q as %s: %t",
+ uentry_getName (spec),
+ ekind_unparseLong (spec->ukind),
+ uentry_getType (spec)),
+ uentry_whereDeclared (spec));
+ }
+ else if (uentry_isSpecified (spec))
+ {
+ if (uentry_hasName (spec))
+ {
+ llgenindentmsg (message ("Specification of %q as %s: %t",
+ uentry_getName (spec),
+ ekind_unparseLong (spec->ukind),
+ uentry_getType (spec)),
+ uentry_whereSpecified (spec));
+ }
+ else
+ {
+ llgenindentmsg (message ("Specification as %s: %t",
+ ekind_unparseLong (spec->ukind),
+ uentry_getType (spec)),
+ uentry_whereSpecified (spec));
+ }
+ }
+ else
+ {
+ /* nothing to show */
+ }
+ }
+}
+
void
uentry_showDefSpecInfo (uentry ce, fileloc fwhere)
{
### This is horrible! Can't we make top_builddir absolute?
SPLINTNEST = ../$(top_builddir)/src/splint$(EXEEXT)
-SPLINTPNEST = @$(SPLINTNEST)
-SPLINTP = @$(SPLINT)
+SPLINTPNEST = @$(SPLINTNEST) -nof
+SPLINTP = @$(SPLINT) -nof
# Make sure .splintrc files are not used so test results do not
# depend on local settings.
-SPLINTRN = $(SPLINTP) -nof -hints -booltype "bool"
+SPLINTRN = $(SPLINTP) -hints -booltype "bool"
SPLINTR = $(SPLINTRN) -exportlocal +debugfcnconstraint
-SPLINTRNNEST = $(SPLINTPNEST) -nof -hints -booltype "bool"
+SPLINTRNNEST = $(SPLINTPNEST) -hints -booltype "bool"
SPLINTRNEST = $(SPLINTRNNEST) -exportlocal +debugfcnconstraint
## Currently disabled tests:
## nullret nullassign warnuse
###
-### !!!
-### These tests have been temporarily removed because of problems with the new build process:
-### fileio tainted mergestate metastate \
-### tests2.2 tests2.2a tests2.4 tests2.5
-###
-### maxset strchr for
+### rcfiles not included becuase file names will not match exactly
+###
UNITTESTS = \
help \
funcpointer glob globals impabstract init inparam internal iter keep libs \
linked lintcomments list macros macrosef merge mergenull modifies modtest moduncon \
mongoincludes mystrncat noeffect null observer oldstyle outglob outparam \
- postnotnull preds prefixes printflike rc rcfiles refcounts release repexpose \
+ postnotnull preds prefixes printflike rc refcounts release repexpose \
returned sharing slovaknames specclauses special stack staticarray strings \
structassign typequals ud ulstypes union unreachable unsignedcompare \
- unused ullint void
+ unused ullint utypes void
UNITEXPECTS = $(addsuffix .expect, $(UNITTESTS))
INTEGTESTS = db1 db2 db3
.PHONY: help
help:
- -@$(SPLINTP)
- -@LARCH_PATH=/dev/null; $(SPLINT) empty.lcl
+ -@$(SPLINT)
+ -@LARCH_PATH=/dev/null; $(SPLINT) -nof empty.lcl
-@$(SPLINTP) -help
-@$(SPLINTP) -asdf
-@$(SPLINTP) +boolint +boolint
${SPLINTRN} ullint.c -expect 5
${SPLINTRN} ullint.c +charint +charintliteral -expect 2
+###
+### 2001-12-30: Poor warnings reported by Peter Deutsch
+###
+
+.PHONY: utypes
+utypes:
+ ${SPLINTRN} utypes.c -expect 6
+
+###
+
.PHONY: void
void:
${SPLINTRN} void.c -expect 2
### This is horrible! Can't we make top_builddir absolute?
SPLINTNEST = ../$(top_builddir)/src/splint$(EXEEXT)
-SPLINTPNEST = @$(SPLINTNEST)
-SPLINTP = @$(SPLINT)
+SPLINTPNEST = @$(SPLINTNEST) -nof
+SPLINTP = @$(SPLINT) -nof
# Make sure .splintrc files are not used so test results do not
# depend on local settings.
-SPLINTRN = $(SPLINTP) -nof -hints -booltype "bool"
+SPLINTRN = $(SPLINTP) -hints -booltype "bool"
SPLINTR = $(SPLINTRN) -exportlocal +debugfcnconstraint
-SPLINTRNNEST = $(SPLINTPNEST) -nof -hints -booltype "bool"
+SPLINTRNNEST = $(SPLINTPNEST) -hints -booltype "bool"
SPLINTRNEST = $(SPLINTRNNEST) -exportlocal +debugfcnconstraint
###
-### !!!
-### These tests have been temporarily removed because of problems with the new build process:
-### fileio tainted mergestate metastate \
-### tests2.2 tests2.2a tests2.4 tests2.5
-###
-### maxset strchr for
+### rcfiles not included becuase file names will not match exactly
+###
UNITTESTS = \
help \
fileio tainted mergestate metastate sizeof buffertest \
funcpointer glob globals impabstract init inparam internal iter keep libs \
linked lintcomments list macros macrosef merge mergenull modifies modtest moduncon \
mongoincludes mystrncat noeffect null observer oldstyle outglob outparam \
- postnotnull preds prefixes printflike rc rcfiles refcounts release repexpose \
+ postnotnull preds prefixes printflike rc refcounts release repexpose \
returned sharing slovaknames specclauses special stack staticarray strings \
structassign typequals ud ulstypes union unreachable unsignedcompare \
- unused ullint void
+ unused ullint utypes void
UNITEXPECTS = $(addsuffix .expect, $(UNITTESTS))
.PHONY: help
help:
- -@$(SPLINTP)
- -@LARCH_PATH=/dev/null; $(SPLINT) empty.lcl
+ -@$(SPLINT)
+ -@LARCH_PATH=/dev/null; $(SPLINT) -nof empty.lcl
-@$(SPLINTP) -help
-@$(SPLINTP) -asdf
-@$(SPLINTP) +boolint +boolint
${SPLINTRN} ullint.c -expect 5
${SPLINTRN} ullint.c +charint +charintliteral -expect 2
+###
+### 2001-12-30: Poor warnings reported by Peter Deutsch
+###
+
+.PHONY: utypes
+utypes:
+ ${SPLINTRN} utypes.c -expect 6
+
+###
+
.PHONY: void
void:
${SPLINTRN} void.c -expect 2
<errno.h>. (See ANSI, Section 4.13.1)
ansireserved.c:1:5: Name decimal_point is reserved for the standard library
ansireserved.c:2:5: Function srand inconsistently declared as variable: int
- load file ansi.lcd:897:1: Specification of srand:
+ load file ansi.lcd:897:1: Specification of srand as function:
[function (unsigned int) returns void]
ansireserved.c:2:5: Name srand is reserved for the standard library
ansireserved.c:3:5: Function labs inconsistently declared as variable: int
- load file ansi.lcd:919:1: Specification of labs:
+ load file ansi.lcd:919:1: Specification of labs as function:
[function (long int) returns long int]
ansireserved.c:3:5: Name labs is reserved for the standard library
ansireserved.c:4:5: Name _x is in the implementation name space (any identifier
--- /dev/null
+/*
+** Added 2001-12-29
+** Test for branchstate bug reported by Jon Wilson
+*/
+
+typedef /*@null@*/ struct s_foo *foo;
+
+struct s_foo {
+ foo p;
+} ;
+
+void f (foo a)
+{
+ while ( a != NULL ) {
+ foo temp = a->p ;
+ a->p = NULL ;
+ a = temp ;
+ }
+}
+
--- /dev/null
+
+Finished checking --- no warnings
--- /dev/null
+/* Define short names for the unsigned types. */
+typedef unsigned char byte;
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+
+/* Since sys/types.h often defines one or more of these (depending on */
+/* the platform), we have to take steps to prevent name clashes. */
+/*** NOTE: This requires that you include std.h *before* any other ***/
+/*** header file that includes sys/types.h. ***/
+#define bool bool_ /* (maybe not needed) */
+#define uchar uchar_
+#define uint uint_
+#define ushort ushort_
+#define ulong ulong_
+#include <sys/types.h>
+#undef bool
+#undef uchar
+#undef uint
+#undef ushort
+#undef ulong
+
+void f (unsigned int width)
+{
+ uint src_bytes = width >> 3;
+}
--- /dev/null
+
+utypes.c:16: Include file <sys/types.h> matches the name of a POSIX library,
+ but the POSIX library is not being used. Consider using +posixlib or
+ +posixstrictlib to select the POSIX library, or -warnposix to suppress this
+ message.
+utypes.c:3:23: Variable uchar inconsistently redeclared as datatype
+ utypes.c:13: Previous definition of uchar as variable: ?
+utypes.c:4:24: Variable ushort inconsistently redeclared as datatype
+ utypes.c:15: Previous definition of ushort as variable: ?
+utypes.c:5:22: Variable uint inconsistently redeclared as datatype
+ utypes.c:14: Previous definition of uint as variable: ?
+utypes.c:6:23: Variable ulong inconsistently redeclared as datatype
+ utypes.c:16: Previous definition of ulong as variable: ?
+utypes.c: (in function f)
+utypes.c:26:8: Variable src_bytes declared but not used
+
+Finished checking --- 6 code warnings, as expected