From 6fcd0b1e01252139211d34a4476d377cf6e5f37a Mon Sep 17 00:00:00 2001 From: evans1629 Date: Sat, 7 Sep 2002 15:22:40 +0000 Subject: [PATCH] Committed my changes (but there are several splintme errors currently). --- configure | 4123 ------------------------------- configure.ac | 5 +- lib/Makefile.in | 1 + lib/bool.h | 4 +- src/Headers/abstract.h | 4 - src/Headers/basic.h | 8 +- src/Headers/cgrammar.h | 1 - src/Headers/cgrammar_tokens.h | 4 +- src/Headers/constants.h | 7 - src/Headers/context.h | 2 - src/Headers/cpp.h | 3 +- src/Headers/cpplib.h | 9 +- src/Headers/cprim.h | 9 +- src/Headers/cscanner.h | 2 + src/Headers/cstring.h | 6 - src/Headers/enumNameList.h | 2 - src/Headers/exprNode.h | 10 +- src/Headers/fileLib.h | 5 +- src/Headers/fileTable.h | 9 +- src/Headers/fileloc.h | 11 +- src/Headers/flags.h | 2 +- src/Headers/forwardTypes.h | 2 - src/Headers/globals.h | 4 - src/Headers/inputStream.h | 6 +- src/Headers/intSet.h | 2 - src/Headers/llbasic.h | 3 - src/Headers/llerror.h | 3 +- src/Headers/llglobals.h | 4 - src/Headers/llmain.h | 9 - src/Headers/lltok.h | 2 + src/Headers/ltoken.h | 4 - src/Headers/misc.h | 2 - src/Headers/osd.h | 5 +- src/Headers/qtype.h | 2 - src/Headers/qual.h | 3 + src/Headers/qualList.h | 2 - src/Headers/rcfiles.h | 2 +- src/Headers/sRef.h | 4 +- src/Headers/stateInfo.h | 11 +- src/Headers/system_constants.h | 2 - src/Headers/uentry.h | 9 +- src/Headers/usymtab-branch.h | 12 - src/Headers/usymtab.h | 13 +- src/Headers/usymtab_interface.h | 4 - src/Headers/version.h | 7 + src/Makefile.am | 12 +- src/Makefile.in | 12 +- src/Makefile.sys | 1 + src/cgrammar.c.der | 235 +- src/cgrammar.y | 77 +- src/clabstract.c | 3 - src/constraintTerm.c | 9 +- src/context.c | 34 +- src/cpperror.c | 2 +- src/cpplib.c | 55 +- src/cppmain.c | 6 + src/cprim.c | 12 +- src/cscanner.l | 215 +- src/cstring.c | 6 - src/cstringList.c | 9 + src/cstringTable.c | 27 +- src/cttable.i | 7 +- src/exprNode.c | 31 +- src/exprNodeList.c | 2 +- src/fileLib.c | 4 - src/fileTable.c | 18 +- src/fileloc.c | 50 +- src/flags.c | 10 +- src/flags.def | 4 +- src/flex.head | 1 + src/general.c | 4 - src/globals.c | 4 - src/inputStream.c | 12 +- src/intSet.c | 2 - src/lcllib.c | 4 +- src/lclscanline.c | 10 +- src/llerror.c | 37 +- src/llmain.c | 78 +- src/lltok.c | 13 + src/nameChecks.c | 3 - src/osd.c | 25 +- src/qtype.c | 6 - src/qual.c | 60 +- src/qualList.c | 4 - src/rcfiles.c | 8 +- src/sRef.c | 23 +- src/stateInfo.c | 63 +- src/transferChecks.c | 3 +- src/uentry.c | 136 +- src/usymtab.c | 58 +- test/Makefile.am | 19 +- test/Makefile.in | 8 +- test/db2.expect | 4 +- test/specclauses.expect | 6 +- 94 files changed, 969 insertions(+), 4807 deletions(-) diff --git a/configure b/configure index 322c3ed..e69de29 100755 --- a/configure +++ b/configure @@ -1,4123 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52 for Splint 3.0.1.7. -# -# Report bugs to . -# -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Name of the executable. -as_me=`echo "$0" |sed 's,.*[\\/],,'` - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -as_executable_p="test -f" - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# NLS nuisances. -$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } -$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } -$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } -$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } -$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } -$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } -$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } -$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -cross_compiling=no -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -ac_unique_file="src/lclinit.c" - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Identity of this package. -PACKAGE_NAME='Splint' -PACKAGE_TARNAME='splint' -PACKAGE_VERSION='3.0.1.7' -PACKAGE_STRING='Splint 3.0.1.7' -PACKAGE_BUGREPORT='splint-bug@splint.org' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: should be removed in autoconf 3.0. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat < if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -EOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue - cd $ac_subdir - # A "../" for each directory in /$ac_subdir. - ac_dots=`echo $ac_subdir | - sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` - - case $srcdir in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_subdir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; - esac - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure.gnu; then - echo - $SHELL $ac_sub_srcdir/configure.gnu --help=recursive - elif test -f $ac_sub_srcdir/configure; then - echo - $SHELL $ac_sub_srcdir/configure --help=recursive - elif test -f $ac_sub_srcdir/configure.ac || - test -f $ac_sub_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\EOF -Splint configure 3.0.1.7 -generated by GNU Autoconf 2.52 - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -EOF - exit 0 -fi -exec 5>config.log -cat >&5 </dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -PATH = $PATH - -_ASUNAME -} >&5 - -cat >&5 <\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" - ac_sep=" " ;; - esac - # Get rid of the leading space. -done - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - echo >&5 - echo "## ----------------- ##" >&5 - echo "## Cache variables. ##" >&5 - echo "## ----------------- ##" >&5 - echo >&5 - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} >&5 - sed "/^$/d" confdefs.h >conftest.log - if test -s conftest.log; then - echo >&5 - echo "## ------------ ##" >&5 - echo "## confdefs.h. ##" >&5 - echo "## ------------ ##" >&5 - echo >&5 - cat conftest.log >&5 - fi - (echo; echo) >&5 - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" >&5 - echo "$as_me: exit $exit_status" >&5 - rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:847: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - cat "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:858: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:866: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:882: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:886: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:892: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:894: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:896: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. It doesn't matter if - # we pass some twice (in addition to the command line arguments). - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" - ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:915: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:917: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac -echo "#! $SHELL" >conftest.sh -echo "exit 0" >>conftest.sh -chmod +x conftest.sh -if { (echo "$as_me:937: PATH=\".;.\"; conftest.sh") >&5 - (PATH=".;."; conftest.sh) 2>&5 - ac_status=$? - echo "$as_me:940: \$? = $ac_status" >&5 - (exit $ac_status); }; then - ac_path_separator=';' -else - ac_path_separator=: -fi -PATH_SEPARATOR="$ac_path_separator" -rm -f conftest.sh - -ac_aux_dir= -for ac_dir in config $srcdir/config; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:966: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:976: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:980: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:989: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:993: error: $ac_config_sub $ac_cv_build_alias failed." >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:998: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -echo "$as_me:1005: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:1014: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:1019: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -echo "$as_me:1026: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1035: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:1040: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 -target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:1066: checking for a BSD compatible install" >&5 -echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_IFS=$IFS; IFS=$ac_path_separator - for ac_dir in $PATH; do - IFS=$ac_save_IFS - # Account for people who put trailing slashes in PATH elements. - case $ac_dir/ in - / | ./ | .// | /cC/* \ - | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ - | /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if $as_executable_p "$ac_dir/$ac_prog"; then - if test $ac_prog = install && - grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:1115: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo "$as_me:1126: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { { echo "$as_me:1150: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:1163: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:1169: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - am_backtick='`' - { echo "$as_me:1194: WARNING: ${am_backtick}missing' script is too old or missing" >&5 -echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} -fi - -for ac_prog in mawk gawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:1202: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_AWK="$ac_prog" -echo "$as_me:1217: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - echo "$as_me:1225: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 -else - echo "$as_me:1228: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$AWK" && break -done - -echo "$as_me:1235: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:1255: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:1259: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" - -fi; -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - -rm -f .deps 2>/dev/null -mkdir .deps 2>/dev/null -if test -d .deps; then - DEPDIR=.deps -else - # MS-DOS does not allow filenames that begin with a dot. - DEPDIR=_deps -fi -rmdir .deps 2>/dev/null - -# test to see if srcdir already configured -if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:1295: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } -fi - -# Define the identity of the package. -PACKAGE=splint -VERSION=3.0.1.7 - -# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow -# the ones we care about. - -# Autoconf 2.50 always computes EXEEXT. However we need to be -# compatible with 2.13, for now. So we always define EXEEXT, but we -# don't compute it. - -# Similar for OBJEXT -- only we only use OBJEXT if the user actually -# requests that it be used. This is a bit dumb. -: ${OBJEXT=o} - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. - - ac_config_headers="$ac_config_headers config.h:config.hin" - -#drl 12-19-2001 commented out so Splint won't depend on C++ -#AC_PROG_CXX -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:1348: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CC="${ac_tool_prefix}gcc" -echo "$as_me:1363: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1371: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1374: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:1383: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="gcc" -echo "$as_me:1398: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:1406: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:1409: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:1422: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CC="${ac_tool_prefix}cc" -echo "$as_me:1437: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1445: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1448: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:1457: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="cc" -echo "$as_me:1472: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:1480: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:1483: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:1496: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue -fi -ac_cv_prog_CC="cc" -echo "$as_me:1516: found $ac_dir/$ac_word" >&5 -break -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1538: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1541: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:1552: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -echo "$as_me:1567: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1575: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1578: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:1591: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="$ac_prog" -echo "$as_me:1606: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:1614: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:1617: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - -test -z "$CC" && { { echo "$as_me:1629: error: no acceptable cc found in \$PATH" >&5 -echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:1634:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1637: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:1640: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:1642: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:1645: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:1647: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:1650: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -#line 1654 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:1670: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:1673: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:1676: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. -for ac_file in `ls a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1699: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:1705: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:1710: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:1716: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1719: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:1726: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:1734: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:1741: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1743: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:1746: checking for executable suffix" >&5 -echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1748: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:1751: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:1767: error: cannot compute EXEEXT: cannot compile and link" >&5 -echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:1773: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:1779: checking for object suffix" >&5 -echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 1785 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1797: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1800: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1812: error: cannot compute OBJEXT: cannot compile" >&5 -echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:1819: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:1823: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 1829 "configure" -#include "confdefs.h" - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1844: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1847: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1850: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1853: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:1865: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:1871: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 1877 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1892: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1895: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1898: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:1908: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1935: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1938: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1941: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1944: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line 1956 "configure" -#include "confdefs.h" -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1969: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1972: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1975: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1978: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line 1988 "configure" -#include "confdefs.h" -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2000: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2003: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2006: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2009: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_config_commands="$ac_config_commands default-1" - -am_make=${MAKE-make} -cat > confinc << 'END' -doit: - @echo done -END -# If we don't find an include directive, just comment out the code. -echo "$as_me:2044: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 -am__include='#' -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote='"' - _am_result=BSD - fi -fi - -echo "$as_me:2071: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 -rm -f confinc confmf - -depcc="$CC" am_compiler_list= - -echo "$as_me:2077: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - echo '#include "conftest.h"' > conftest.c - echo 'int i;' > conftest.h - echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=conftest.c object=conftest.o \ - depfile=conftest.Po tmpdepfile=conftest.TPo \ - $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && - grep conftest.h conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -echo "$as_me:2139: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 -CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:2148: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line 2169 "configure" -#include "confdefs.h" -#include - Syntax error -_ACEOF -if { (eval echo "$as_me:2174: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:2180: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line 2203 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:2207: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:2213: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:2250: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line 2260 "configure" -#include "confdefs.h" -#include - Syntax error -_ACEOF -if { (eval echo "$as_me:2265: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:2271: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line 2294 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:2298: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:2304: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:2332: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -for ac_prog in flex lex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:2347: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_LEX="$ac_prog" -echo "$as_me:2362: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - echo "$as_me:2370: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 -else - echo "$as_me:2373: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$LEX" && break -done -test -n "$LEX" || LEX="${am_missing_run}flex" - -for ac_prog in flex lex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:2385: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_LEX="$ac_prog" -echo "$as_me:2400: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - echo "$as_me:2408: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 -else - echo "$as_me:2411: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$LEX" && break -done -test -n "$LEX" || LEX=":" - -if test -z "$LEXLIB" -then - echo "$as_me:2421: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 2429 "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2448: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:2451: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2454: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2457: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_fl_yywrap=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_fl_yywrap=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:2468: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 -if test $ac_cv_lib_fl_yywrap = yes; then - LEXLIB="-lfl" -else - echo "$as_me:2473: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 -if test "${ac_cv_lib_l_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ll $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 2481 "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2500: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:2503: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2506: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2509: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_l_yywrap=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_l_yywrap=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:2520: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 -if test $ac_cv_lib_l_yywrap = yes; then - LEXLIB="-ll" -fi - -fi - -fi - -if test "x$LEX" != "x:"; then - echo "$as_me:2531: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -echo '%% -%%' | $LEX -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - { { echo "$as_me:2545: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } -fi -fi -echo "$as_me:2550: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -echo "$as_me:2554: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS=$LIBS -LIBS="$LIBS $LEXLIB" -cat >conftest.$ac_ext <<_ACEOF -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2570: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:2573: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2576: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2579: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_lex_yytext_pointer=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS -rm -f "${LEX_OUTPUT_ROOT}.c" - -fi -echo "$as_me:2591: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 -if test $ac_cv_prog_lex_yytext_pointer = yes; then - -cat >>confdefs.h <<\EOF -#define YYTEXT_POINTER 1 -EOF - -fi - -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:2615: checking for a BSD compatible install" >&5 -echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_IFS=$IFS; IFS=$ac_path_separator - for ac_dir in $PATH; do - IFS=$ac_save_IFS - # Account for people who put trailing slashes in PATH elements. - case $ac_dir/ in - / | ./ | .// | /cC/* \ - | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ - | /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if $as_executable_p "$ac_dir/$ac_prog"; then - if test $ac_prog = install && - grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:2664: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo "$as_me:2675: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:2695: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:2699: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -echo "$as_me:2704: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:2708: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:2711: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -# Extract the first word of "bison", so it can be a program name with args. -set dummy bison; ac_word=$2 -echo "$as_me:2717: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_BISON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BISON"; then - ac_cv_prog_BISON="$BISON" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_BISON="bison" -echo "$as_me:2732: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_BISON" && ac_cv_prog_BISON="no" -fi -fi -BISON=$ac_cv_prog_BISON -if test -n "$BISON"; then - echo "$as_me:2741: result: $BISON" >&5 -echo "${ECHO_T}$BISON" >&6 -else - echo "$as_me:2744: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "grep", so it can be a program name with args. -set dummy grep; ac_word=$2 -echo "$as_me:2750: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$GREP"; then - ac_cv_prog_GREP="$GREP" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_GREP="grep" -echo "$as_me:2765: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_GREP" && ac_cv_prog_GREP="grep-is-missing" -fi -fi -GREP=$ac_cv_prog_GREP -if test -n "$GREP"; then - echo "$as_me:2774: result: $GREP" >&5 -echo "${ECHO_T}$GREP" >&6 -else - echo "$as_me:2777: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "diff", so it can be a program name with args. -set dummy diff; ac_word=$2 -echo "$as_me:2783: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_DIFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$DIFF"; then - ac_cv_prog_DIFF="$DIFF" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_DIFF="diff" -echo "$as_me:2798: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_DIFF" && ac_cv_prog_DIFF="diff-is-missing" -fi -fi -DIFF=$ac_cv_prog_DIFF -if test -n "$DIFF"; then - echo "$as_me:2807: result: $DIFF" >&5 -echo "${ECHO_T}$DIFF" >&6 -else - echo "$as_me:2810: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "cat", so it can be a program name with args. -set dummy cat; ac_word=$2 -echo "$as_me:2816: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CAT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CAT"; then - ac_cv_prog_CAT="$CAT" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CAT="cat" -echo "$as_me:2831: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_CAT" && ac_cv_prog_CAT="cat-is-missing" -fi -fi -CAT=$ac_cv_prog_CAT -if test -n "$CAT"; then - echo "$as_me:2840: result: $CAT" >&5 -echo "${ECHO_T}$CAT" >&6 -else - echo "$as_me:2843: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "rm", so it can be a program name with args. -set dummy rm; ac_word=$2 -echo "$as_me:2849: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RM"; then - ac_cv_prog_RM="$RM" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_RM="rm" -echo "$as_me:2864: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_RM" && ac_cv_prog_RM="rm-is-missing" -fi -fi -RM=$ac_cv_prog_RM -if test -n "$RM"; then - echo "$as_me:2873: result: $RM" >&5 -echo "${ECHO_T}$RM" >&6 -else - echo "$as_me:2876: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "mv", so it can be a program name with args. -set dummy mv; ac_word=$2 -echo "$as_me:2882: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_MV+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$MV"; then - ac_cv_prog_MV="$MV" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_MV="mv" -echo "$as_me:2897: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_MV" && ac_cv_prog_MV="mv-is-missing" -fi -fi -MV=$ac_cv_prog_MV -if test -n "$MV"; then - echo "$as_me:2906: result: $MV" >&5 -echo "${ECHO_T}$MV" >&6 -else - echo "$as_me:2909: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "cp", so it can be a program name with args. -set dummy cp; ac_word=$2 -echo "$as_me:2915: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CP"; then - ac_cv_prog_CP="$CP" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CP="cp" -echo "$as_me:2930: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_CP" && ac_cv_prog_CP="cp-is-missing" -fi -fi -CP=$ac_cv_prog_CP -if test -n "$CP"; then - echo "$as_me:2939: result: $CP" >&5 -echo "${ECHO_T}$CP" >&6 -else - echo "$as_me:2942: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -echo "$as_me:2946: checking whether we need _ALL_SOURCE to expose mode_t" >&5 -echo $ECHO_N "checking whether we need _ALL_SOURCE to expose mode_t... $ECHO_C" >&6 -all=no -cat >conftest.$ac_ext <<_ACEOF -#line 2950 "configure" -#include "confdefs.h" - -#include -mode_t x; - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2965: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2968: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2971: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2974: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -all=maybe -fi -rm -f conftest.$ac_objext conftest.$ac_ext -if test $all = maybe ; then -cat >conftest.$ac_ext <<_ACEOF -#line 2985 "configure" -#include "confdefs.h" - -#define _ALL_SOURCE -#include -mode_t x; - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3004: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3007: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3010: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cat >>confdefs.h <<\EOF -#define _ALL_SOURCE 1 -EOF - all=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -if test $all = maybe ; then all=no ; fi -echo "$as_me:3023: result: $all" >&5 -echo "${ECHO_T}$all" >&6 - -LCLOBJ='$(lcl_OBJECTS)' - -# Check whether --with-lcl or --without-lcl was given. -if test "${with_lcl+set}" = set; then - withval="$with_lcl" - ac_cv_use_lcl=$withval -else - echo "$as_me:3033: checking whether to include support for LCL files" >&5 -echo $ECHO_N "checking whether to include support for LCL files... $ECHO_C" >&6 -if test "${ac_cv_use_lcl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_use_lcl=yes -fi -echo "$as_me:3040: result: $ac_cv_use_lcl" >&5 -echo "${ECHO_T}$ac_cv_use_lcl" >&6 -fi; -if test x$ac_cv_use_lcl != xyes; then - LCLOBJ= - -cat >>confdefs.h <<\EOF -#define NOLCL 1 -EOF - -fi - -# Make sure we have an actual value for $prefix -myprefix=$prefix -test x$myprefix = xNONE && myprefix=$ac_default_prefix - -### Yuck! This is really kludgey, but I don't understand autoconf well -### enough to do something simple that always works. Hopefully this does. - -# cpplib.h defines 2 include dirs; one is $includedir, the other is gcc's -# include dir. Not the most portable setup, but let's do our best. - -if test x$GCC = xyes; then - -# 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/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 <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <<\EOF -#define UNIX 1 -EOF - -#just define some Header constants for now... - -UNAME=`uname` -cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overriden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if cmp -s $cache_file confcache; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -DEFS=-DHAVE_CONFIG_H - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:3267: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -SHELL=\${CONFIG_SHELL-$SHELL} -ac_cs_invocation="\$0 \$@" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Name of the executable. -as_me=`echo "$0" |sed 's,.*[\\/],,'` - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -as_executable_p="test -f" - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# NLS nuisances. -$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } -$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } -$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } -$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } -$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } -$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } -$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } -$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } - -exec 6>&1 - -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\EOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." -EOF - -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift - ;; - -*);; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_need_defaults=false;; - esac - - case $1 in - # Handling of the options. -EOF -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:3443: 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;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" - ac_need_defaults=false;; - - # This is an error. - -*) { { echo "$as_me:3462: 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;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -exec 5>>config.log -cat >&5 << _ACEOF - -## ----------------------- ## -## Running config.status. ## -## ----------------------- ## - -This file was extended by $as_me (Splint 3.0.1.7) 2.52, executed with - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - > $ac_cs_invocation -on `(hostname || uname -n) 2>/dev/null | sed 1q` - -_ACEOF -EOF - -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "imports/Makefile" ) CONFIG_FILES="$CONFIG_FILES imports/Makefile" ;; - "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; - "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; - "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; - *) { { echo "$as_me:3516: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} -{ - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=$TMPDIR/cs$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - { (exit 1); exit 1; } -} - -EOF - -cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@DEFS@,$DEFS,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@AMTAR@,$AMTAR,;t t -s,@install_sh@,$install_sh,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@CPP@,$CPP,;t t -s,@LEX@,$LEX,;t t -s,@LEXLIB@,$LEXLIB,;t t -s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@LN_S@,$LN_S,;t t -s,@BISON@,$BISON,;t t -s,@GREP@,$GREP,;t t -s,@DIFF@,$DIFF,;t t -s,@CAT@,$CAT,;t t -s,@RM@,$RM,;t t -s,@MV@,$MV,;t t -s,@CP@,$CP,;t t -s,@LCLOBJ@,$LCLOBJ,;t t -CEOF - -EOF - - cat >>$CONFIG_STATUS <<\EOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -EOF -cat >>$CONFIG_STATUS <<\EOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || mkdir "$as_incr_dir" - ;; - esac -done; } - - ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` - else - ac_dir_suffix= ac_dots= - fi - - case $srcdir in - .) ac_srcdir=. - if test -z "$ac_dots"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_dots$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_dots$srcdir ;; - esac - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_dots$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:3766: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated automatically by config.status. */ - configure_input="Generated automatically from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:3784: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:3797: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -EOF -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -EOF -cat >>$CONFIG_STATUS <<\EOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:3858: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:3869: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:3882: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -EOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\EOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -EOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\EOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -EOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\EOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated automatically by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated automatically by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - 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:3999: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || mkdir "$as_incr_dir" - ;; - esac -done; } - - fi - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi - # Run the commands associated with the file. - case $ac_file in - config.h ) # update the timestamp -echo timestamp >"./stamp-h1" - ;; - esac -done -EOF -cat >>$CONFIG_STATUS <<\EOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - - case $ac_dest in - default-1 ) -test x"$AMDEP_TRUE" != x"" || -for mf in $CONFIG_FILES; do - case "$mf" in - Makefile) dirpart=.;; - */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; - *) continue;; - esac - grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` - test -z "$DEPDIR" && continue - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`echo "$file" | sed -e 's|/[^/]*$||'` - $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - esac -done -EOF - -cat >>$CONFIG_STATUS <<\EOF - -{ (exit 0); exit 0; } -EOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/configure.ac b/configure.ac index d416af0..cf9dc1d 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,7 @@ AC_CHECK_PROG(CAT, cat, cat, cat-is-missing) AC_CHECK_PROG(RM, rm, rm, rm-is-missing) AC_CHECK_PROG(MV, mv, mv, mv-is-missing) AC_CHECK_PROG(CP, cp, cp, cp-is-missing) +AC_CHECK_PROG(SED, sed, sed, sed-is-missing) dnl Checks for header files. dnl Currently all disable, as the source files don't care about the results @@ -137,8 +138,10 @@ GCC_INCLUDE_DIR=/usr/include AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR", [system include directory]) else - AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "/usr/include", [system include directory]) +GCC_INCLUDE_DIR=/usr/include +AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR, "$GCC_INCLUDE_DIR", [system include directory]) fi + AC_DEFINE_UNQUOTED(GCC_INCLUDE_DIR2, "$myprefix/include", [alternate include directory]) diff --git a/lib/Makefile.in b/lib/Makefile.in index 18df940..8cc7b3e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -82,6 +82,7 @@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RM = @RM@ +SED = @SED@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ diff --git a/lib/bool.h b/lib/bool.h index ff9294b..3d223f0 100644 --- a/lib/bool.h +++ b/lib/bool.h @@ -16,8 +16,8 @@ typedef int bool; /* ** bool_initMod has no real effect -** Declared with modifies internalState, so no noeffect errors are -** reported when it is called.) +** Declared with modifies internalState, so no warnings about no effects are +** reported when it is called. */ extern /*@unused@*/ void bool_initMod (void) /*@modifies internalState@*/ ; diff --git a/src/Headers/abstract.h b/src/Headers/abstract.h index 68cc226..b9f15cd 100644 --- a/src/Headers/abstract.h +++ b/src/Headers/abstract.h @@ -6,10 +6,6 @@ # ifndef ABSTRACT_H # define ABSTRACT_H -# ifdef NOLCL -# error "Bad include" -# endif - /* ** These two are needed in symtable.c */ diff --git a/src/Headers/basic.h b/src/Headers/basic.h index 28fdd54..f894e91 100644 --- a/src/Headers/basic.h +++ b/src/Headers/basic.h @@ -30,6 +30,8 @@ # include "fileloc.h" # include "globals.h" # include "cpp.h" +# include "cstringSList.h" +# include "cstringList.h" # include "flag_codes.h" # include "flags.h" # include "flagSpec.h" @@ -41,15 +43,11 @@ # include "warnClause.h" # include "functionClause.h" # include "functionClauseList.h" -# include "cstringSList.h" -# include "cstringList.h" # include "llerror.h" # include "fileLib.h" # include "inputStream.h" # include "qualList.h" # include "pointers.h" - -# ifndef NOLCL # include "code.h" # include "mapping.h" # include "sort.h" @@ -59,8 +57,6 @@ # include "lsymbol.h" # include "abstract.h" # include "symtable.h" -# endif - # include "exprNodeList.h" # include "cprim.h" # include "cstringTable.h" diff --git a/src/Headers/cgrammar.h b/src/Headers/cgrammar.h index 9eccdc7..6130229 100644 --- a/src/Headers/cgrammar.h +++ b/src/Headers/cgrammar.h @@ -11,7 +11,6 @@ extern bool g_expectingTypeName ; extern /*@dependent@*/ /*@observer@*/ uentry coerceId (cstring p_cn); extern /*@observer@*/ uentry coerceIterId (cstring p_cn); -extern /*@observer@*/ cstring LastIdentifier (void); /*@=declundef@*/ /* #ifndef NCGRAM2 diff --git a/src/Headers/cgrammar_tokens.h b/src/Headers/cgrammar_tokens.h index 569def2..d166391 100644 --- a/src/Headers/cgrammar_tokens.h +++ b/src/Headers/cgrammar_tokens.h @@ -99,7 +99,7 @@ typedef union constraintList conL; constraintExpr conE; /* drl */ -} YYSTYPE; +} cgrammar_YYSTYPE; #define BADTOK 257 #define SKIPTOK 258 #define CTOK_ELIPSIS 259 @@ -294,7 +294,7 @@ typedef union #define METASTATE_NAME 448 -extern YYSTYPE yylval; +extern cgrammar_YYSTYPE yylval; /* ** Resets all flags in bison.head */ diff --git a/src/Headers/constants.h b/src/Headers/constants.h index de8dd15..261b39e 100644 --- a/src/Headers/constants.h +++ b/src/Headers/constants.h @@ -205,13 +205,6 @@ /*@constant int MAX_PRAGMA_LEN; @*/ # define MAX_PRAGMA_LEN PRAGMA_LEN_EXPAND -/* -** Minimum version with compatible libraries. -*/ - -/*@constant float SPLINT_LIBVERSION; @*/ -# define SPLINT_LIBVERSION 2.7 - /* ** Flex doesn't pre-process input, so remember to copy these manually ** to cscanner.l. diff --git a/src/Headers/context.h b/src/Headers/context.h index d26ccf7..1e03aff 100644 --- a/src/Headers/context.h +++ b/src/Headers/context.h @@ -104,7 +104,6 @@ extern /*@dependent@*/ /*@observer@*/ cstring context_tmpdir (void); extern void context_enterMTfile (void) /*@modifies internalState@*/ ; extern void context_exitMTfile (void) /*@modifies internalState@*/ ; -# ifndef NOLCL extern void context_enterLCLfile (void); extern void context_exitLCLfile (void); extern void context_enterImport (void) ; @@ -115,7 +114,6 @@ extern bool context_msgLh (void) /*@*/ ; extern bool context_inLCLLib (void) /*@globals internalState@*/ ; extern bool context_inImport (void) /*@globals internalState@*/ ; extern void context_resetSpecLines (void) /*@modifies internalState@*/ ; -# endif extern void context_exitMacroCache (void); extern void context_enterSuppressRegion (fileloc); diff --git a/src/Headers/cpp.h b/src/Headers/cpp.h index 669ca00..dc66f3d 100644 --- a/src/Headers/cpp.h +++ b/src/Headers/cpp.h @@ -46,7 +46,8 @@ extern /*@only@*/ cstring cppReader_getIncludePath (void) ; extern int cppProcess (/*@dependent@*/ cstring p_infile, /*@dependent@*/ cstring p_outfile); extern void cppAddIncludeDir (cstring); -extern void cppReader_initMod (void); +extern void cppReader_initMod (void) /*@modifies internalState@*/ ; +extern void cppReader_destroyMod (void) /*@modifies internalState@*/ ; extern void cppDoDefine (cstring); extern void cppDoUndefine (cstring); extern void cppReader_saveDefinitions (void); diff --git a/src/Headers/cpplib.h b/src/Headers/cpplib.h index 28b3b91..cdefe6b 100644 --- a/src/Headers/cpplib.h +++ b/src/Headers/cpplib.h @@ -189,10 +189,6 @@ struct cppReader { int lineno; /*@null@*/ /*@observer@*/ struct tm *timebuf; - -#ifdef __cplusplus - ~cppReader () { cppCleanup (this); } -#endif }; /*@constant int cppReader_fatalErrorLimit; @*/ @@ -273,7 +269,7 @@ struct cppOptions { /* Name of output file, for error messages. */ /*@dependent@*/ cstring out_fname; - struct file_name_map_list *map_list; + /*@only@*/ struct file_name_map_list *map_list; /* Non-0 means -v, so print the full set of include dirs. */ bool verbose; @@ -358,6 +354,7 @@ struct cppOptions { /* First dir to search */ /*@owned@*/ struct file_name_list *include; + /* First dir to search for */ /* This is the first element to use for #include <...>. If it is 0, use the entire chain for such includes. */ @@ -583,7 +580,7 @@ struct file_name_list }; extern void cppReader_addIncludeChain (/*@special@*/ cppReader *p_pfile, - /*@keep@*/ struct file_name_list *p_dir) + /*@only@*/ struct file_name_list *p_dir) /*@uses p_pfile->opts, p_pfile->max_include_len@*/ /*@modifies p_pfile, p_dir@*/ ; diff --git a/src/Headers/cprim.h b/src/Headers/cprim.h index a0eb0d8..4720f9e 100644 --- a/src/Headers/cprim.h +++ b/src/Headers/cprim.h @@ -93,8 +93,13 @@ extern bool cprim_isAnyChar (/*@sef@*/ cprim p_c); extern bool cprim_isAnyInt (/*@sef@*/ cprim p_c); extern bool cprim_isAnyReal (/*@sef@*/ cprim p_c); -# define cprim_isAnyInt(c) ((c) >= CTX_INT && (c) <= CTX_SIGNEDINTEGRAL) -# define cprim_isAnyReal(c) ((c) >= CTX_FLOAT && (c) <= CTX_LDOUBLE) +# define cprim_isAnyInt(c) ((c) >= CTX_INT && (c) <= CTX_SIGNEDINTEGRAL) + +extern bool cprim_isAnyUnsignedInt (/*@sef@*/ cprim p_c); +# define cprim_isAnyUnsignedInt(c) ((c) == CTX_UINT || (c) == CTX_USINT \ + || (c) == CTX_ULINT || (c) == CTX_ULLINT \ + || (c) == CTX_UNSIGNEDINTEGRAL) +# define cprim_isAnyReal(c) ((c) >= CTX_FLOAT && (c) <= CTX_LDOUBLE) /*@constant int CTX_LAST;@*/ # define CTX_LAST CTX_LDOUBLE diff --git a/src/Headers/cscanner.h b/src/Headers/cscanner.h index b06a0f0..81e722f 100644 --- a/src/Headers/cscanner.h +++ b/src/Headers/cscanner.h @@ -7,5 +7,7 @@ ** cscanner.h */ +extern /*@observer@*/ cstring cscanner_observeLastIdentifier (void) ; extern void cscanner_expectingMetaStateName (void) /*@modifies internalState@*/ ; extern void cscanner_clearExpectingMetaStateName (void) /*@modifies internalState@*/ ; +extern void cscanner_swallowMacro (void) /*@modifies internalState, fileSystem@*/ ; diff --git a/src/Headers/cstring.h b/src/Headers/cstring.h index 154cc91..0e42cec 100644 --- a/src/Headers/cstring.h +++ b/src/Headers/cstring.h @@ -84,9 +84,7 @@ extern bool cstring_equalLit (cstring p_c1, char *p_c2) /*@*/ ; extern int cstring_compare (cstring p_c1, cstring p_c2) /*@*/ ; extern int cstring_xcompare (cstring *p_c1, cstring *p_c2) /*@*/ ; -# ifndef NOLCL extern bool cstring_hasNonAlphaNumBar (cstring p_s) /*@*/ ; -# endif extern cstring cstring_elide (cstring p_s, size_t p_len) /*@*/ ; @@ -127,13 +125,11 @@ extern cstring extern cstring cstring_fromCharsNew (/*:untainted@*/ /*@null@*/ char *p_s) /*@*/ ; # define cstring_fromCharsNew(s) cstring_copy(cstring_fromChars(s)) -# ifndef NOLCL extern /*@exposed@*/ /*@notnull@*/ /*@untainted@*/ char *cstring_toCharsSafeO (/*@only@*/ /*@exposed@*/ /*@returned@*/ cstring p_s); /*@-mustfree@*/ # define cstring_toCharsSafeO(s) cstring_toCharsSafe(s) /*@=mustfree@*/ -# endif extern void cstring_free (/*@only@*/ cstring p_s); @@ -180,13 +176,11 @@ extern cstring cstring_concatFree1 (/*@only@*/ cstring p_s, cstring p_t) /*@modifies p_s@*/ ; -# ifndef NOLCL extern cstring cstring_concatChars (/*@only@*/ cstring p_s, char *p_t) /*@modifies p_s@*/ ; extern lsymbol cstring_toSymbol (/*@only@*/ cstring p_s) /*@*/ ; -# endif extern void cstring_markOwned (/*@owned@*/ cstring p_s) /*@modifies p_s@*/ ; diff --git a/src/Headers/enumNameList.h b/src/Headers/enumNameList.h index d041a39..57bddf1 100644 --- a/src/Headers/enumNameList.h +++ b/src/Headers/enumNameList.h @@ -8,10 +8,8 @@ typedef cstring enumName ; -# ifndef NOLCL extern /*@only@*/ enumName enumName_create (/*@only@*/ cstring p_s) /*@*/ ; # define enumName_create(s) (s) -# endif typedef /*@only@*/ enumName o_enumName; diff --git a/src/Headers/exprNode.h b/src/Headers/exprNode.h index f9ff80c..1e68d4f 100644 --- a/src/Headers/exprNode.h +++ b/src/Headers/exprNode.h @@ -348,17 +348,15 @@ extern exprNode exprNode_iterExpr (/*@returned@*/ exprNode p_e); extern exprNode exprNode_iterNewId (/*@only@*/ cstring p_s); extern exprNode exprNode_iterStart (/*@observer@*/ uentry p_name, /*@only@*/ exprNodeList p_alist); -extern exprNode - exprNode_numLiteral (ctype p_c, /*@temp@*/ cstring p_t, - /*@only@*/ fileloc p_loc, long p_val); +extern exprNode exprNode_numLiteral (ctype p_c, /*@temp@*/ cstring p_t, + /*@only@*/ fileloc p_loc, long p_val) /*@*/ ; extern void exprNode_initMod (void) /*@modifies internalState@*/ ; extern exprNode exprNode_for (/*@keep@*/ exprNode p_inc, /*@keep@*/ exprNode p_body); extern exprNode exprNode_forPred (/*@only@*/ exprNode p_init, /*@only@*/ exprNode p_test, /*@only@*/ exprNode p_inc); -extern exprNode - exprNode_floatLiteral (double p_d, ctype p_ct, - cstring p_text, /*@only@*/ fileloc p_loc); +extern exprNode exprNode_floatLiteral (double p_d, ctype p_ct, + cstring p_text, /*@only@*/ fileloc p_loc) /*@*/ ; extern /*@notnull@*/ exprNode exprNode_createId (/*@observer@*/ uentry p_c); extern /*@notnull@*/ exprNode exprNode_makeConstantString (/*@temp@*/ cstring p_c, /*@only@*/ fileloc p_loc) /*@*/ ; extern exprNode exprNode_cast (/*@only@*/ lltok p_tok, /*@only@*/ exprNode p_e, /*@only@*/ qtype p_q); diff --git a/src/Headers/fileLib.h b/src/Headers/fileLib.h index d25aff3..9e69056 100644 --- a/src/Headers/fileLib.h +++ b/src/Headers/fileLib.h @@ -16,13 +16,10 @@ extern bool fileLib_isCExtension (cstring p_ext) /*@*/ ; extern cstring fileLib_addExtension (cstring p_s, cstring p_suffix); extern cstring fileLib_withoutExtension (cstring p_s, cstring p_suffix) /*@*/ ; -# ifndef NOLCL extern cstring fileLib_removePath (cstring p_s) /*@*/ ; -# endif - extern cstring fileLib_removePathFree (/*@only@*/ cstring p_s) /*@*/ ; extern cstring fileLib_removeAnyExtension (cstring p_s) /*@*/ ; -extern cstring fileLib_cleanName (cstring p_s) /*@*/ ; +extern /*@only@*/ cstring fileLib_cleanName (/*@temp@*/ cstring p_s) /*@*/ ; extern bool fileLib_hasExtension (cstring p_s, cstring p_ext) /*@*/ ; extern /*@observer@*/ cstring diff --git a/src/Headers/fileTable.h b/src/Headers/fileTable.h index 8083be9..4063745 100644 --- a/src/Headers/fileTable.h +++ b/src/Headers/fileTable.h @@ -25,7 +25,7 @@ typedef enum { FILE_NORMAL, FILE_LSLTEMP, FILE_NODELETE, bool ftemp BOOLBITS; bool fsystem BOOLBITS; bool fspecial BOOLBITS; - cstring fname; + /*@only@*/ cstring fname; cstring basename; fileType ftype; fileId fder; @@ -51,7 +51,7 @@ abst_typedef /*@null@*/ struct int nopen; int nopenspace; - /*@reldef@*/ /*@only@*/ foentry *openelements; + /*@reldef@*/ /*@only@*/ foentry *openelements; /* evans 2002-07-12: removed reldef */ } *fileTable ; /*@constant null fileTable fileTable_undefined; @*/ @@ -80,14 +80,11 @@ extern fileId fileTable_addXHFile (fileTable p_ft, cstring p_name) extern fileId fileTable_addLibraryFile (fileTable p_ft, cstring p_name) /*@modifies p_ft@*/ ; -# ifndef NOLCL extern fileId fileTable_addLCLFile (fileTable p_ft, cstring p_name) /*@modifies p_ft@*/ ; extern fileId fileTable_addltemp (fileTable p_ft); -# endif - extern /*@notnull@*/ /*@only@*/ fileTable fileTable_create (void) /*@*/ ; extern fileId fileTable_lookup (fileTable p_ft, cstring p_s) /*@*/ ; extern fileId fileTable_addCTempFile (fileTable p_ft, fileId p_fid) @@ -95,10 +92,8 @@ extern fileId fileTable_addCTempFile (fileTable p_ft, fileId p_fid) extern fileId fileTable_addFileOnly (fileTable p_ft, /*@only@*/ cstring p_name) /*@modifies p_ft@*/ ; -# ifndef NOLCL extern fileId fileTable_addImportFile (fileTable p_ft, cstring p_name) /*@modifies p_ft@*/ ; -# endif extern fileId fileTable_addMacrosFile (fileTable p_ft) /*@modifies p_ft@*/ ; diff --git a/src/Headers/fileloc.h b/src/Headers/fileloc.h index d8dc68c..163d460 100644 --- a/src/Headers/fileloc.h +++ b/src/Headers/fileloc.h @@ -36,10 +36,7 @@ extern fileloc fileloc_create (fileId p_fid, int p_line, int p_col) /*@*/ ; extern bool fileloc_isSystemFile (fileloc p_f1) /*@*/ ; extern bool fileloc_isXHFile (fileloc p_f1) /*@*/ ; -# ifndef NOLCL extern fileloc fileloc_createSpec (fileId p_fid, int p_line, int p_col) /*@*/ ; -# endif - extern fileloc fileloc_createLib (cstring p_ln) /*@*/ ; extern fileloc fileloc_createRc (cstring p_name) /*@*/ ; extern fileloc fileloc_decColumn (fileloc p_f, int p_x) /*@*/ ; @@ -47,11 +44,9 @@ extern void fileloc_subColumn (fileloc p_f, int p_x) /*@modifies p_f@*/ ; extern fileloc fileloc_getBuiltin (void) /*@*/ ; extern /*@observer@*/ fileloc fileloc_observeBuiltin (void) /*@*/ ; extern fileloc fileloc_createBuiltin (void) /*@*/ ; - -# ifndef NOLCL extern fileloc fileloc_createImport (cstring p_fname, int p_lineno) /*@*/ ; -# endif +extern void fileloc_destroyMod (void) /*@modifies internalState@*/ ; extern bool fileloc_isSpecialFile (fileloc p_f) /*@*/ ; extern bool fileloc_sameBaseFile (fileloc p_f1, fileloc p_f2) /*@*/ ; extern /*@observer@*/ cstring fileloc_filename (fileloc p_f) /*@*/ ; @@ -95,9 +90,7 @@ extern bool fileloc_isInvalid (/*@sef@*/ /*@null@*/ fileloc p_f) /*@*/ ; extern bool fileloc_isLib (fileloc p_f) /*@*/ ; -# ifndef NOLCL extern fileloc fileloc_fromTok (ltoken p_t) /*@*/ ; -# endif /*@constant int UNKNOWN_LINE; @*/ # define UNKNOWN_LINE (0) @@ -114,11 +107,9 @@ extern /*@unused@*/ bool fileloc_columnDefined (/*@sef@*/ fileloc p_f) /*@*/ ; # define fileloc_columnDefined(f) \ (fileloc_isValid (f) && (f)->column != UNKNOWN_COLUMN) -# ifndef NOLCL extern void fileloc_setColumnUndefined (/*@sef@*/ fileloc p_f) /*@modifies p_f@*/; # define fileloc_setColumnUndefined(f) \ (fileloc_isDefined(f) ? (f)->column = UNKNOWN_COLUMN : UNKNOWN_COLUMN) -# endif extern /*@falsewhennull@*/ bool fileloc_isValid (/*@sef@*/ fileloc p_f); # define fileloc_isValid(f) \ diff --git a/src/Headers/flags.h b/src/Headers/flags.h index 4cf14a2..9251134 100644 --- a/src/Headers/flags.h +++ b/src/Headers/flags.h @@ -111,7 +111,7 @@ flags_processFlags (bool p_inCommandLine, fileIdList p_cfiles, fileIdList p_lclfiles, fileIdList p_mtfiles, - cstringSList *p_passThroughArgs, + cstringList *p_passThroughArgs, int p_argc, /*@null@*/ char **p_argv) /*@requires maxRead(p_argv) >= (p_argc - 1) @*/ /* returns true if normal, false if execution should exit */ ; diff --git a/src/Headers/forwardTypes.h b/src/Headers/forwardTypes.h index 3963638..af3c8a4 100644 --- a/src/Headers/forwardTypes.h +++ b/src/Headers/forwardTypes.h @@ -1,9 +1,7 @@ # ifndef FORWARDTYPES_H # define FORWARDTYPES_H -# ifndef NOLCL # include "lclForwardTypes.h" -# endif abst_typedef /*@null@*/ struct s_sRef *sRef; abst_typedef /*@null@*/ struct s_uentry *uentry; diff --git a/src/Headers/globals.h b/src/Headers/globals.h index 75e70c5..5b30848 100644 --- a/src/Headers/globals.h +++ b/src/Headers/globals.h @@ -48,10 +48,8 @@ extern int g_prevCodeLine; extern /*@observer@*/ char *g_localSpecPath; -# ifndef NOLCL extern /*@only@*/ cstring g_currentSpec; extern /*@null@*/ /*@only@*/ char *g_currentSpecName; -# endif extern void setCodePoint (void); # define setCodePoint() \ @@ -106,13 +104,11 @@ extern void setColumn (int p_n) /*@modifies g_currentloc; @*/ ; # define setColumn(n) (fileloc_setColumn(g_currentloc, n)) -# ifndef NOLCL extern void setSpecFileId (fileId p_s) /*@globals fileloc g_currentloc; @*/ /*@modifies g_currentloc; @*/ ; # define setSpecFileId(s) \ (fileloc_reallyFree (g_currentloc), g_currentloc = fileloc_createSpec (s, 1, 1)) -# endif extern void setFileLine (fileId p_s, int p_line) /*@globals fileloc g_currentloc; @*/ diff --git a/src/Headers/inputStream.h b/src/Headers/inputStream.h index d50c826..599530f 100644 --- a/src/Headers/inputStream.h +++ b/src/Headers/inputStream.h @@ -13,7 +13,7 @@ # define STUBMAXRECORDSIZE 800 struct s_inputStream { - cstring name; + /*@only@*/ cstring name; /*:open:*/ /*@dependent@*/ /*@null@*/ FILE *file; char buffer[STUBMAXRECORDSIZE+1]; int lineNo; @@ -37,8 +37,10 @@ extern /*@nullwhentrue@*/ bool inputStream_isUndefined (/*@null@*/ inputStream p extern void inputStream_free (/*@null@*/ /*@only@*/ inputStream p_s); extern bool inputStream_close (inputStream p_s) /*@modifies p_s, fileSystem@*/ ; -extern inputStream + +extern /*@only@*/ inputStream inputStream_create (/*@only@*/ cstring p_name, cstring p_suffix, bool p_echo) /*@*/ ; + extern inputStream inputStream_fromString (cstring p_name, cstring p_str) /*@*/ ; extern /*@dependent@*/ /*@null@*/ char *inputStream_nextLine(inputStream p_s) /*@modifies p_s@*/ ; diff --git a/src/Headers/intSet.h b/src/Headers/intSet.h index db5e9aa..9701474 100644 --- a/src/Headers/intSet.h +++ b/src/Headers/intSet.h @@ -39,9 +39,7 @@ extern /*@unused@*/ bool intSet_member (intSet p_s, int p_el); extern /*@only@*/ /*@unused@*/ cstring intSet_unparse (intSet p_s); extern void intSet_free (/*@only@*/ intSet p_s); -# ifndef NOLCL extern /*@only@*/ cstring intSet_unparseText (intSet p_s); -# endif /*@constant int intSetBASESIZE;@*/ # define intSetBASESIZE SMALLBASESIZE diff --git a/src/Headers/llbasic.h b/src/Headers/llbasic.h index caa8ee9..c5294a9 100644 --- a/src/Headers/llbasic.h +++ b/src/Headers/llbasic.h @@ -8,10 +8,7 @@ # define LLBASIC_H # include "basic.h" - -# ifndef NOLCL # include "llglobals.h" -# endif # else # error "Multiple include" diff --git a/src/Headers/llerror.h b/src/Headers/llerror.h index a1f18b7..5b7bef1 100644 --- a/src/Headers/llerror.h +++ b/src/Headers/llerror.h @@ -149,7 +149,7 @@ extern void llparseerror (/*@only@*/ cstring p_s) /*@modifies g_warningstream@*/ ; # define llparseerror(p_s) xllparseerror (__FILE__, __LINE__, p_s) -# ifndef NOLCL + extern /*@noreturn@*/ void lclplainfatalerror (/*@only@*/ cstring p_msg) /*@modifies g_warningstream@*/ ; extern /*@noreturn@*/ void lclfatalbug (/*@temp@*/ char *p_msg) /*@modifies g_warningstream@*/ ; extern int lclNumberErrors (void) /*@*/ ; @@ -166,7 +166,6 @@ extern void lclbug (/*@only@*/ cstring p_s); extern void lclplainerror (/*@only@*/ cstring p_msg); extern bool lclHadError (void); extern void lclRedeclarationError (ltoken p_id); -# endif extern void llerror_flagWarning (/*@only@*/ cstring p_s) /*@modifies g_warningstream@*/ ; diff --git a/src/Headers/llglobals.h b/src/Headers/llglobals.h index 44f727b..316475e 100644 --- a/src/Headers/llglobals.h +++ b/src/Headers/llglobals.h @@ -6,10 +6,6 @@ # ifndef LLGLOBALS_H # define LLGLOBALS_H -# ifdef NOLCL -# error "Bad include" -# endif - extern /*@only@*/ lsymbolSet g_currentImports; extern /*@only@*/ symtable g_symtab; diff --git a/src/Headers/llmain.h b/src/Headers/llmain.h index 3d7b0fc..fe44cfe 100644 --- a/src/Headers/llmain.h +++ b/src/Headers/llmain.h @@ -7,12 +7,6 @@ # define LLMAIN_H extern int main (int p_argc, char *p_argv[]) -# ifdef NOLCL - /*@globals killed undef g_currentloc, - killed undef yyin, - undef g_warningstream;@*/ - /*@modifies g_currentloc, fileSystem, internalState, yyin;@*/ -# else /*@globals killed undef g_currentloc, killed undef g_currentSpec, killed undef g_currentSpecName, @@ -23,7 +17,6 @@ extern int main (int p_argc, char *p_argv[]) /*@modifies g_currentloc, g_currentSpec, g_currentSpecName, yyin, internalState, fileSystem; @*/ -# endif ; extern /*@noreturn@*/ void llexit (int p_status); @@ -34,10 +27,8 @@ extern void showHerald (void); extern int yyparse (void); extern void yyrestart (/*@dependent@*/ FILE *); -# ifndef NOLCL extern int ylparse (void); extern int lslparse (void); -# endif extern /*:open:*/ /*@dependent@*/ FILE *yyin; /*@=incondefs@*/ /*@=redecl@*/ diff --git a/src/Headers/lltok.h b/src/Headers/lltok.h index 3b0ceca..4188f67 100644 --- a/src/Headers/lltok.h +++ b/src/Headers/lltok.h @@ -19,6 +19,8 @@ typedef /*@abstract@*/ struct extern lltok lltok_create (int p_tok, /*@only@*/ fileloc p_loc) /*@modifies nothing@*/ ; extern /*@observer@*/ cstring lltok_unparse (lltok p_tok) /*@*/ ; extern void lltok_free (/*@only@*/ lltok p_t) ; +extern void lltok_free2 (/*@only@*/ lltok p_t1, /*@only@*/ lltok p_t2) ; +extern void lltok_free3 (/*@only@*/ lltok p_t1, /*@only@*/ lltok p_t2, /*@only@*/ lltok p_t3) ; extern /*@dependent@*/ /*@exposed@*/ fileloc lltok_getLoc (lltok p_t) /*@*/ ; extern int lltok_getTok (lltok p_t) /*@*/ ; diff --git a/src/Headers/ltoken.h b/src/Headers/ltoken.h index ef9f3f3..ffe5ec9 100644 --- a/src/Headers/ltoken.h +++ b/src/Headers/ltoken.h @@ -7,10 +7,6 @@ ** ltoken.h */ -# ifdef NOLCL -# error "Bad include" -# endif - # ifndef LTOKEN_H # define LTOKEN_H diff --git a/src/Headers/misc.h b/src/Headers/misc.h index a13ec3a..c35b296 100644 --- a/src/Headers/misc.h +++ b/src/Headers/misc.h @@ -12,9 +12,7 @@ # ifndef MISC_H # define MISC_H -# ifndef NOLCL # include "lclMisc.h" -# endif extern void assertSet (/*@special@*/ /*@sef@*/ /*@unused@*/ void *p_x) /*@sets p_x, *p_x@*/ ; diff --git a/src/Headers/osd.h b/src/Headers/osd.h index f4f8f64..6b9d44a 100644 --- a/src/Headers/osd.h +++ b/src/Headers/osd.h @@ -79,15 +79,14 @@ extern /*@observer@*/ cstring osd_getHomeDir (void) /*@*/ ; extern /*@observer@*/ cstring osd_getEnvironmentVariable (cstring) ; -# ifndef NOLCL /*@constant int CALL_SUCCESS@*/ # define CALL_SUCCESS 0 extern int osd_system (cstring p_cmd) /*@modifies fileSystem@*/ ; -# endif extern cstring osd_absolutePath (cstring p_cwd, cstring p_filename) /*@*/ ; -extern cstring osd_outputPath (cstring p_filename) /*@*/ ; +extern /*@only@*/ cstring osd_outputPath (cstring p_filename) /*@*/ ; extern void osd_initMod (void) /*@modifies internalState@*/ ; +extern void osd_destroyMod (void) /*@modifies internalState@*/ ; extern bool osd_equalCanonicalPrefix (cstring p_dirpath, cstring p_prefixpath) /*@*/ ; diff --git a/src/Headers/qtype.h b/src/Headers/qtype.h index 208e332..3b02ef4 100644 --- a/src/Headers/qtype.h +++ b/src/Headers/qtype.h @@ -38,11 +38,9 @@ extern /*@exposed@*/ qualList qtype_getQuals (/*@sef@*/ qtype p_q); extern void qtype_setType (/*@sef@*/ qtype p_q, ctype p_c); # define qtype_setType(q, c) (qtype_isDefined(q) ? (q)->type = (c) : (c)) -# ifndef NOLCL extern qtype qtype_addQualList (/*@returned@*/ qtype p_qt, qualList p_ql); extern qtype qtype_mergeImplicitAlt (/*@returned@*/ qtype p_q1, /*@only@*/ qtype p_q2); extern /*@only@*/ qtype qtype_copy (qtype p_q); -# endif extern /*@notnull@*/ qtype qtype_create (ctype p_c) /*@*/ ; extern /*@only@*/ qtype qtype_unknown(void) /*@*/ ; diff --git a/src/Headers/qual.h b/src/Headers/qual.h index 646e8ab..44e2727 100644 --- a/src/Headers/qual.h +++ b/src/Headers/qual.h @@ -159,6 +159,9 @@ extern bool qual_isSharing (/*@sef@*/ qual) /*@*/ ; extern /*@observer@*/ annotationInfo qual_getAnnotationInfo (qual) /*@*/ ; +extern void qual_initMod (void) /*@modifies internalState@*/ ; +extern void qual_destroyMod (void) /*@modifies internalState@*/ ; + # define qual_isUnknown(q) ((q)->kind == QU_UNKNOWN) # define qual_isTrueNull(q) ((q)->kind == QU_TRUENULL) # define qual_isFalseNull(q) ((q)->kind == QU_FALSENULL) diff --git a/src/Headers/qualList.h b/src/Headers/qualList.h index 3a2c32d..68e2b68 100644 --- a/src/Headers/qualList.h +++ b/src/Headers/qualList.h @@ -47,10 +47,8 @@ extern /*@only@*/ cstring qualList_unparse (qualList p_s) /*@*/ ; extern void qualList_free (/*@only@*/ qualList p_s) ; extern qualList qualList_appendList (/*@returned@*/ qualList p_s, qualList p_t); -# ifndef NOLCL extern qualList qualList_copy (qualList p_s); extern /*@only@*/ cstring qualList_toCComments (qualList p_s); -# endif extern void qualList_clear (qualList p_q); diff --git a/src/Headers/rcfiles.h b/src/Headers/rcfiles.h index fa0e0aa..ddc8bae 100644 --- a/src/Headers/rcfiles.h +++ b/src/Headers/rcfiles.h @@ -11,7 +11,7 @@ # define RCFILES_H extern bool rcfiles_read (cstring p_fname, - cstringSList *p_passThroughArgs, + cstringList *p_passThroughArgs, bool p_report) /*@modifies fileSystem, internalState, *p_passThroughArgs@*/ ; diff --git a/src/Headers/sRef.h b/src/Headers/sRef.h index bde8d45..53249e0 100644 --- a/src/Headers/sRef.h +++ b/src/Headers/sRef.h @@ -325,7 +325,9 @@ extern /*@exposed@*/ sRef sRef_buildPointer (/*@exposed@*/ sRef p_t) /*@modifies p_t@*/ ; extern /*@exposed@*/ sRef sRef_makeAddress (/*@exposed@*/ sRef p_t); -extern /*@notnull@*/ /*@dependent@*/ sRef sRef_makeUnconstrained (/*@exposed@*/ cstring) /*@*/ ; + +/* evans 2002-07-12: the parameter was exposed (but this led to invalid reads, reported by valgrind */ +extern /*@notnull@*/ /*@dependent@*/ sRef sRef_makeUnconstrained (/*@temp@*/ cstring) /*@*/ ; extern /*@falsewhennull@*/ bool sRef_isUnconstrained (sRef p_s) /*@*/ ; diff --git a/src/Headers/stateInfo.h b/src/Headers/stateInfo.h index 2e2d223..c556e1d 100644 --- a/src/Headers/stateInfo.h +++ b/src/Headers/stateInfo.h @@ -9,12 +9,15 @@ # ifndef STATEINFO_H # define STATEINFO_H -typedef /*@null@*/ struct +typedef /*@null@*/ struct s_stateInfo *stateInfo ; + + +/*@null@*/ struct s_stateInfo { /*@only@*/ fileloc loc; /*@observer@*/ sRef ref; - /*@observer@*/ uentry ue; -} *stateInfo; + /*@null@*/ stateInfo previous; +} ; /*@constant null stateInfo stateInfo_undefined@*/ # define stateInfo_undefined (NULL) @@ -40,6 +43,8 @@ extern /*@only@*/ stateInfo stateInfo_makeRefLoc (/*@exposed@*/ sRef p_ref, file extern /*@observer@*/ fileloc stateInfo_getLoc (stateInfo p_info) ; extern /*@only@*/ cstring stateInfo_unparse (stateInfo p_s) /*@*/ ; +extern void stateInfo_display (stateInfo p_s, /*@only@*/ cstring p_sname) /*@modifies g_errorstream@*/ ; + # else # error "Multiple include" # endif diff --git a/src/Headers/system_constants.h b/src/Headers/system_constants.h index c7a34d6..2cb07a5 100644 --- a/src/Headers/system_constants.h +++ b/src/Headers/system_constants.h @@ -5,9 +5,7 @@ # ifndef SYSTEM_CONSTANTS_H # define SYSTEM_CONSTANTS_H -# ifndef NOLCL # include "lcl_constants.h" -# endif /* exit codes */ diff --git a/src/Headers/uentry.h b/src/Headers/uentry.h index f335c93..ec9e60b 100644 --- a/src/Headers/uentry.h +++ b/src/Headers/uentry.h @@ -118,7 +118,7 @@ typedef struct typedef struct { - typeIdSet access; + typeIdSet access; } *ueinfo ; typedef union @@ -365,7 +365,6 @@ extern /*@observer@*/ stateClauseList uentry_getStateClauseList (uentry p_ue) /* extern void uentry_showWhereLastExtra (uentry p_spec, /*@only@*/ cstring p_extra) /*@modifies g_warningstream@*/ ; -# ifndef NOLCL extern void uentry_setRefCounted (uentry p_e); extern /*@notnull@*/ /*@only@*/ uentry uentry_makeUnnamedVariable (ctype p_t); @@ -395,7 +394,6 @@ extern /*@notnull@*/ uentry uentry_makeSpecFunction (cstring p_n, ctype p_t, typeIdSet p_access, /*@only@*/ globSet p_globs, /*@only@*/ sRefSet p_mods, /*@keep@*/ fileloc p_f); -# endif extern /*@notnull@*/ uentry uentry_makeEnumConstant (cstring p_n, ctype p_t) /*@*/ ; @@ -463,10 +461,8 @@ extern /*@notnull@*/ uentry extern /*@notnull@*/ /*@only@*/ uentry uentry_makeVariableLoc (cstring p_n, ctype p_t); -# ifndef NOLCL extern /*@notnull@*/ /*@only@*/ uentry uentry_makeVariableParam (cstring p_n, ctype p_t, fileloc p_loc); -# endif extern /*@notnull@*/ /*@only@*/ uentry uentry_makeVariableSrefParam (cstring p_n, ctype p_t, /*@only@*/ fileloc p_loc, @@ -530,6 +526,7 @@ extern void uentry_showWhereDeclared (uentry p_spec) /*@modifies g_warningstream extern /*@notnull@*/ /*@only@*/ uentry uentry_makeIdVariable (idDecl p_t) /*@*/ ; extern uentry uentry_copy (uentry p_e) /*@*/ ; +extern uentry uentry_copyNoSave (uentry p_e) /*@*/ ; /* for use for uentries that do not live beyond function exits */ extern void uentry_freeComplete (/*@only@*/ uentry p_e) ; extern void uentry_clearDefined (uentry p_e) /*@modifies p_e@*/; extern /*@observer@*/ cstring uentry_specDeclName (uentry p_u) /*@*/ ; @@ -579,7 +576,7 @@ extern int uentry_xcompareuses (uentry *p_p1, uentry *p_p2) /*@*/ ; extern /*@observer@*/ cstring uentry_specOrDefName (uentry p_u) /*@*/ ; extern void uentry_copyState (uentry p_res, uentry p_other); extern bool uentry_sameKind (uentry p_u1, uentry p_u2); -extern /*@exposed@*/ sRef uentry_returnedRef (uentry p_u, exprNodeList p_args); +extern /*@exposed@*/ sRef uentry_returnedRef (uentry p_u, exprNodeList p_args, fileloc p_loc); extern bool uentry_isReturned (uentry p_u); extern bool uentry_isRefCountedDatatype (uentry p_e); extern sstate uentry_getDefState (uentry p_u); diff --git a/src/Headers/usymtab-branch.h b/src/Headers/usymtab-branch.h index db405bf..b4d999b 100644 --- a/src/Headers/usymtab-branch.h +++ b/src/Headers/usymtab-branch.h @@ -124,20 +124,16 @@ extern /*@observer@*/ uentry usymtab_lookupStructTag (cstring p_k) extern /*@observer@*/ uentry usymtab_lookupEither (cstring p_k) /*@globals internalState@*/ ; -# ifndef NOLCL extern ctype usymtab_lookupType (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_isDefinitelyNull (sRef p_s) /*@globals internalState@*/ ; extern bool usymtab_isDefinitelyNullDeep (sRef p_s) /*@globals internalState@*/ ; -# ifndef NOLCL extern usymId usymtab_supExposedTypeEntry (/*@only@*/ uentry p_e, bool p_dodef) /*@modifies internalState, p_e@*/ ; -# endif extern ctype usymtab_supTypeEntry (/*@only@*/ uentry p_e) /*@modifies internalState, p_e@*/ ; @@ -154,10 +150,8 @@ extern /*@observer@*/ uentry usymtab_getGlobalEntry (usymId p_uid) extern bool usymtab_exists (cstring p_k) /*@globals internalState@*/ ; -# ifndef NOLCL extern bool usymtab_existsVar (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_existsGlob (cstring p_k) /*@globals internalState@*/ ; @@ -165,10 +159,8 @@ extern bool usymtab_existsGlob (cstring p_k) extern bool usymtab_existsType (cstring p_k) /*@globals internalState@*/ ; -# ifndef NOLCL extern bool usymtab_existsEither (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_existsTypeEither (cstring p_k) /*@globals internalState@*/ ; @@ -179,10 +171,8 @@ extern usymId usymtab_getTypeId (cstring p_k) /*@globals internalState@*/ ; extern void usymtab_supEntry (/*@only@*/ uentry p_e) /*@modifies internalState, p_e@*/ ; -# ifndef NOLCL extern void usymtab_replaceEntry (/*@only@*/ uentry p_s) /*@modifies internalState, p_s@*/ ; -# endif extern void usymtab_supEntrySref (/*@only@*/ uentry p_e) /*@modifies internalState, p_e@*/ ; @@ -318,9 +308,7 @@ extern void usymtab_printGuards (void) /*@globals internalState@*/ /*@modifies * extern void usymtab_quietPlainExitScope (void) /*@modifies internalState@*/ ; extern void usymtab_printComplete (void) /*@globals internalState@*/ /*@modifies *stdout@*/ ; -# ifndef NOLCL extern bool usymtab_existsGlobEither (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_isBoolType (usymId p_uid) /*@globals internalState@*/ ; extern /*@only@*/ cstring diff --git a/src/Headers/usymtab.h b/src/Headers/usymtab.h index 2f590f1..7b1dbed 100644 --- a/src/Headers/usymtab.h +++ b/src/Headers/usymtab.h @@ -108,20 +108,16 @@ extern /*@observer@*/ uentry usymtab_lookupStructTag (cstring p_k) extern /*@observer@*/ uentry usymtab_lookupEither (cstring p_k) /*@globals internalState@*/ ; -# ifndef NOLCL extern ctype usymtab_lookupType (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_isDefinitelyNull (sRef p_s) /*@globals internalState@*/ ; extern bool usymtab_isDefinitelyNullDeep (sRef p_s) /*@globals internalState@*/ ; -# ifndef NOLCL extern usymId usymtab_supExposedTypeEntry (/*@only@*/ uentry p_e, bool p_dodef) /*@modifies internalState, p_e@*/ ; -# endif extern ctype usymtab_supTypeEntry (/*@only@*/ uentry p_e) /*@modifies internalState, p_e@*/ ; @@ -138,10 +134,8 @@ extern /*@observer@*/ uentry usymtab_getGlobalEntry (usymId p_uid) extern bool usymtab_exists (cstring p_k) /*@globals internalState@*/ ; -# ifndef NOLCL extern bool usymtab_existsVar (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_existsGlob (cstring p_k) /*@globals internalState@*/ ; @@ -149,10 +143,8 @@ extern bool usymtab_existsGlob (cstring p_k) extern bool usymtab_existsType (cstring p_k) /*@globals internalState@*/ ; -# ifndef NOLCL extern bool usymtab_existsEither (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_existsTypeEither (cstring p_k) /*@globals internalState@*/ ; @@ -163,10 +155,8 @@ extern usymId usymtab_getTypeId (cstring p_k) /*@globals internalState@*/ ; extern void usymtab_supEntry (/*@only@*/ uentry p_e) /*@modifies internalState, p_e@*/ ; -# ifndef NOLCL extern void usymtab_replaceEntry (/*@only@*/ uentry p_s) /*@modifies internalState, p_s@*/ ; -# endif extern void usymtab_supEntrySref (/*@only@*/ uentry p_e) /*@modifies internalState, p_e@*/ ; @@ -256,6 +246,7 @@ extern /*@observer@*/ uentry usymtab_lookupEnumTag (cstring p_k) extern usymId usymtab_convertId (usymId p_uid) /*@globals internalState@*/ ; extern void usymtab_initMod (void) /*@modifies internalState@*/ ; +extern void usymtab_destroyMod (void) /*@modifies internalState@*/ ; extern void usymtab_initBool (void) /*@modifies internalState@*/ ; extern void usymtab_initGlobalMarker (void) /*@modifies internalState@*/ ; @@ -302,9 +293,7 @@ extern void usymtab_printGuards (void) /*@globals internalState@*/ /*@modifies * extern void usymtab_quietPlainExitScope (void) /*@modifies internalState@*/ ; extern void usymtab_printComplete (void) /*@globals internalState@*/ /*@modifies *stdout@*/ ; -# ifndef NOLCL extern bool usymtab_existsGlobEither (cstring p_k) /*@globals internalState@*/ ; -# endif extern bool usymtab_isBoolType (typeId p_uid) /*@globals internalState@*/ ; extern /*@only@*/ cstring usymtab_getTypeEntryName (typeId p_uid) diff --git a/src/Headers/usymtab_interface.h b/src/Headers/usymtab_interface.h index cb2abf2..8e543f9 100644 --- a/src/Headers/usymtab_interface.h +++ b/src/Headers/usymtab_interface.h @@ -6,10 +6,6 @@ # ifndef USYMTAB_INTERFACE_H # define USYMTAB_INTERFACE_H -# ifdef NOLCL -# error "Bad include" -# endif - extern void doDeclareConstant (constDeclarationNode, bool); extern void doDeclareVar (varDeclarationNode, bool); extern void doDeclareType (typeNode, bool); diff --git a/src/Headers/version.h b/src/Headers/version.h index 458aebe..49a4aef 100644 --- a/src/Headers/version.h +++ b/src/Headers/version.h @@ -9,6 +9,13 @@ # ifndef VERSION_H # define VERSION_H +/* +** Minimum version with compatible libraries. +*/ + +/*@constant float SPLINT_LIBVERSION; @*/ +# define SPLINT_LIBVERSION 3.0 + /*@constant observer char *SPLINT_MAINTAINER; @*/ # define SPLINT_MAINTAINER "splint-bug@splint.org" diff --git a/src/Makefile.am b/src/Makefile.am index cd9ece6..762d60b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -251,7 +251,7 @@ COMMONSRC = $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \ ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(OVERFLOWCHSRC) $(DER_FILES) $(HEADERSRC) #files to run Splint on -LINTSRC = $(COMMONSRC) $(SPLINTSRC) +LINTSRC = $(COMMONSRC) $(SPLINTSRC) cscanner.c cgrammar.c #ALLSRC = $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC) @@ -302,10 +302,10 @@ Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y echo '* Expect 154 shift/reduce conflicts and 115 reduce/reduce conflicts.'; \ echo '* (see cgrammar.y for explanation)'; \ $(BISON) $(YFLAGS) cgrammar.y; \ - $(CAT) bison.head cgrammar.tab.c bison.reset >cgrammar.c; \ + $(CAT) bison.head cgrammar.tab.c bison.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > cgrammar.c; \ $(CP) cgrammar.c cgrammar.c.der; \ $(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak; \ - $(CAT) bison.head cgrammar.tab.h bison.reset >Headers/cgrammar_tokens.h; \ + $(CAT) bison.head cgrammar.tab.h bison.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > Headers/cgrammar_tokens.h; \ $(RM) cgrammar.tab.c cgrammar.tab.h; \ fi @@ -346,7 +346,7 @@ Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der ll cscanner.c: cscanner.l $(LEX) $(LFLAGS) cscanner.l - $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset > cscanner.c + $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > cscanner.c Headers/flag_codes.gen: flags.def grep "FLG_" flags.def > Headers/flag_codes.gen @@ -377,6 +377,10 @@ lintnew: splintme splintme: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +valsplint: + valgrind -v --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=yes ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw + + splintsome: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude lcllib.c -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +partial diff --git a/src/Makefile.in b/src/Makefile.in index 044831e..659c177 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -80,6 +80,7 @@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RM = @RM@ +SED = @SED@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ @@ -337,7 +338,7 @@ COMMONSRC = $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \ ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(OVERFLOWCHSRC) $(DER_FILES) $(HEADERSRC) #files to run Splint on -LINTSRC = $(COMMONSRC) $(SPLINTSRC) +LINTSRC = $(COMMONSRC) $(SPLINTSRC) cscanner.c cgrammar.c #ALLSRC = $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC) @@ -994,10 +995,10 @@ Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y echo '* Expect 154 shift/reduce conflicts and 115 reduce/reduce conflicts.'; \ echo '* (see cgrammar.y for explanation)'; \ $(BISON) $(YFLAGS) cgrammar.y; \ - $(CAT) bison.head cgrammar.tab.c bison.reset >cgrammar.c; \ + $(CAT) bison.head cgrammar.tab.c bison.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > cgrammar.c; \ $(CP) cgrammar.c cgrammar.c.der; \ $(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak; \ - $(CAT) bison.head cgrammar.tab.h bison.reset >Headers/cgrammar_tokens.h; \ + $(CAT) bison.head cgrammar.tab.h bison.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > Headers/cgrammar_tokens.h; \ $(RM) cgrammar.tab.c cgrammar.tab.h; \ fi @@ -1033,7 +1034,7 @@ Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der ll cscanner.c: cscanner.l $(LEX) $(LFLAGS) cscanner.l - $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset > cscanner.c + $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > cscanner.c Headers/flag_codes.gen: flags.def grep "FLG_" flags.def > Headers/flag_codes.gen @@ -1058,6 +1059,9 @@ lintnew: splintme splintme: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +valsplint: + valgrind -v --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=yes ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw + splintsome: ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude lcllib.c -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +partial diff --git a/src/Makefile.sys b/src/Makefile.sys index eb60131..564dc7c 100644 --- a/src/Makefile.sys +++ b/src/Makefile.sys @@ -76,6 +76,7 @@ RM = rm -f MV = mv -f CP = cp CAT = cat +SED = sed MAKEDEPEND = makedepend LASTBACKUP = lastbackup diff --git a/src/cgrammar.c.der b/src/cgrammar.c.der index 8d84bff..ed3ad33 100644 --- a/src/cgrammar.c.der +++ b/src/cgrammar.c.der @@ -275,7 +275,6 @@ /*@=allmacros@*/ extern int yylex (); -extern void swallowMacro (void); extern void yyerror (char *); # include "splintMacros.nf" @@ -353,7 +352,7 @@ typedef union constraintList conL; constraintExpr conE; /* drl */ -} YYSTYPE; +} cgrammar_YYSTYPE; #ifndef YYDEBUG #define YYDEBUG 1 #endif @@ -720,76 +719,76 @@ static const short yyrhs[] = { -1, #if YYDEBUG != 0 static const short yyrline[] = { 0, - 325, 326, 329, 330, 333, 334, 335, 336, 337, 338, - 339, 340, 343, 345, 349, 349, 356, 362, 366, 367, - 371, 372, 374, 376, 391, 394, 404, 407, 415, 416, - 418, 420, 436, 439, 447, 450, 458, 460, 460, 464, - 465, 466, 467, 470, 473, 477, 477, 480, 480, 485, - 486, 489, 494, 495, 498, 499, 502, 507, 508, 511, - 512, 513, 516, 517, 518, 523, 524, 527, 529, 531, - 533, 542, 544, 546, 548, 564, 568, 569, 576, 577, - 585, 587, 591, 592, 593, 594, 595, 596, 599, 600, - 601, 602, 603, 604, 607, 610, 611, 618, 621, 624, - 630, 638, 640, 644, 647, 648, 651, 654, 660, 664, - 665, 668, 671, 672, 675, 676, 677, 680, 681, 682, - 683, 684, 687, 688, 689, 690, 691, 694, 695, 698, - 705, 709, 711, 715, 716, 718, 725, 735, 736, 739, - 740, 741, 742, 743, 744, 745, 746, 750, 751, 755, - 756, 759, 761, 763, 764, 765, 766, 767, 769, 773, - 774, 777, 781, 793, 794, 795, 796, 797, 798, 799, - 800, 804, 805, 806, 807, 808, 809, 810, 811, 812, - 813, 817, 818, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 834, 835, 837, 840, 844, 845, - 848, 849, 850, 851, 854, 855, 859, 860, 861, 862, - 865, 866, 867, 870, 871, 872, 875, 876, 877, 878, - 879, 882, 883, 884, 887, 888, 891, 892, 896, 897, - 900, 901, 906, 912, 913, 919, 925, 926, 926, 928, - 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, - 941, 942, 945, 946, 949, 950, 953, 958, 959, 960, - 963, 977, 982, 988, 990, 996, 1001, 1001, 1005, 1006, - 1008, 1009, 1012, 1015, 1018, 1021, 1022, 1025, 1026, 1029, - 1030, 1031, 1032, 1039, 1040, 1044, 1045, 1048, 1049, 1052, - 1054, 1063, 1064, 1065, 1066, 1067, 1070, 1073, 1079, 1088, - 1091, 1094, 1101, 1108, 1114, 1139, 1140, 1143, 1144, 1145, - 1146, 1147, 1150, 1151, 1152, 1153, 1156, 1157, 1158, 1159, - 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, - 1170, 1171, 1172, 1176, 1177, 1180, 1181, 1184, 1185, 1188, - 1189, 1190, 1191, 1194, 1195, 1196, 1197, 1198, 1199, 1202, - 1203, 1204, 1205, 1208, 1209, 1210, 1211, 1214, 1215, 1216, - 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1232, - 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, - 1243, 1244, 1245, 1248, 1252, 1253, 1257, 1258, 1262, 1263, - 1264, 1267, 1268, 1272, 1277, 1279, 1281, 1283, 1285, 1287, - 1288, 1290, 1292, 1294, 1296, 1297, 1298, 1301, 1302, 1304, - 1306, 1307, 1310, 1313, 1314, 1315, 1318, 1320, 1324, 1326, - 1330, 1331, 1332, 1336, 1338, 1338, 1340, 1343, 1345, 1347, - 1350, 1355, 1362, 1363, 1364, 1370, 1374, 1375, 1379, 1380, - 1383, 1384, 1385, 1388, 1389, 1392, 1393, 1394, 1395, 1398, - 1399, 1402, 1403, 1406, 1407, 1408, 1411, 1411, 1412, 1413, - 1416, 1428, 1444, 1445, 1448, 1449, 1450, 1453, 1454, 1457, - 1459, 1460, 1462, 1463, 1465, 1467, 1469, 1471, 1477, 1478, - 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1489, 1492, 1495, - 1496, 1500, 1502, 1504, 1506, 1510, 1511, 1513, 1517, 1519, - 1521, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, - 1533, 1534, 1535, 1536, 1539, 1540, 1545, 1548, 1551, 1552, - 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, - 1565, 1568, 1569, 1576, 1577, 1583, 1584, 1585, 1586, 1589, - 1590, 1591, 1592, 1595, 1596, 1600, 1603, 1606, 1609, 1612, - 1615, 1618, 1619, 1620, 1621, 1623, 1624, 1626, 1628, 1634, - 1638, 1640, 1642, 1644, 1648, 1649, 1652, 1653, 1656, 1657, - 1660, 1661, 1664, 1665, 1668, 1669, 1672, 1673, 1674, 1677, - 1690, 1695, 1696, 1700, 1701, 1704, 1709, 1712, 1713, 1714, - 1722, 1723, 1723, 1727, 1728, 1729, 1740, 1747, 1748, 1751, - 1752, 1755, 1756, 1757, 1758, 1759, 1761, 1762, 1763, 1764, - 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, - 1779, 1780, 1783, 1784, 1785, 1786, 1789, 1790, 1791, 1794, - 1795, 1796, 1799, 1800, 1801, 1802, 1803, 1806, 1807, 1808, - 1811, 1812, 1815, 1816, 1820, 1821, 1824, 1825, 1828, 1829, - 1832, 1833, 1834, 1835, 1838, 1839, 1840, 1841, 1842, 1843, - 1844, 1845, 1846, 1847, 1848, 1849, 1852, 1853, 1856, 1859, - 1861, 1863, 1867, 1868, 1870, 1872, 1875, 1876, 1877, 1879, - 1880, 1881, 1882, 1883, 1884, 1885, 1888, 1889, 1892, 1893, - 1896, 1899, 1900, 1901, 1902, 1903, 1906, 1907, 1908, 1909 + 324, 325, 328, 329, 332, 333, 334, 335, 336, 337, + 338, 339, 342, 344, 348, 348, 356, 362, 366, 367, + 371, 372, 374, 376, 393, 396, 407, 410, 419, 420, + 422, 426, 443, 446, 455, 458, 468, 470, 470, 476, + 477, 478, 479, 482, 485, 489, 489, 494, 494, 501, + 502, 505, 510, 511, 514, 515, 518, 523, 524, 527, + 528, 529, 532, 533, 534, 539, 540, 543, 545, 547, + 549, 558, 560, 562, 564, 580, 584, 585, 592, 593, + 601, 603, 607, 608, 609, 610, 611, 612, 615, 616, + 617, 618, 619, 620, 623, 626, 627, 634, 637, 640, + 646, 654, 656, 660, 663, 664, 667, 670, 676, 680, + 681, 684, 687, 688, 691, 692, 693, 696, 697, 698, + 699, 700, 703, 704, 705, 706, 707, 710, 711, 714, + 721, 725, 727, 731, 732, 734, 741, 751, 752, 755, + 756, 757, 758, 759, 760, 761, 762, 766, 767, 771, + 772, 775, 777, 779, 780, 781, 782, 783, 785, 789, + 790, 793, 797, 809, 810, 811, 812, 813, 814, 815, + 816, 820, 821, 822, 823, 824, 825, 826, 827, 828, + 829, 833, 834, 837, 838, 839, 840, 841, 842, 843, + 844, 845, 846, 847, 850, 851, 853, 856, 861, 862, + 865, 866, 867, 868, 871, 872, 876, 877, 878, 879, + 882, 883, 884, 887, 888, 889, 892, 893, 894, 895, + 896, 899, 900, 901, 904, 905, 908, 909, 913, 914, + 917, 918, 923, 929, 930, 936, 942, 943, 943, 945, + 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, + 958, 959, 962, 963, 966, 967, 970, 975, 976, 977, + 980, 994, 999, 1005, 1007, 1013, 1018, 1018, 1022, 1023, + 1025, 1026, 1029, 1032, 1035, 1038, 1039, 1042, 1043, 1046, + 1047, 1048, 1049, 1056, 1057, 1061, 1062, 1065, 1066, 1069, + 1071, 1080, 1081, 1082, 1083, 1084, 1087, 1090, 1096, 1105, + 1108, 1111, 1118, 1125, 1131, 1156, 1157, 1160, 1161, 1162, + 1163, 1164, 1167, 1168, 1169, 1170, 1173, 1174, 1175, 1176, + 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, + 1187, 1188, 1189, 1193, 1194, 1197, 1198, 1201, 1202, 1205, + 1206, 1207, 1208, 1211, 1212, 1213, 1214, 1215, 1216, 1219, + 1220, 1221, 1222, 1225, 1226, 1227, 1228, 1231, 1232, 1233, + 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1249, + 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, + 1260, 1261, 1262, 1265, 1269, 1270, 1274, 1275, 1279, 1280, + 1281, 1284, 1285, 1289, 1294, 1296, 1298, 1300, 1302, 1304, + 1305, 1307, 1309, 1311, 1313, 1314, 1315, 1318, 1319, 1321, + 1323, 1324, 1327, 1330, 1331, 1332, 1335, 1337, 1341, 1343, + 1347, 1348, 1349, 1353, 1355, 1355, 1357, 1360, 1362, 1364, + 1367, 1372, 1379, 1380, 1381, 1387, 1391, 1392, 1396, 1397, + 1400, 1401, 1402, 1405, 1406, 1409, 1410, 1411, 1412, 1415, + 1416, 1419, 1420, 1423, 1424, 1425, 1428, 1428, 1429, 1430, + 1433, 1445, 1461, 1462, 1465, 1466, 1467, 1470, 1471, 1474, + 1476, 1477, 1479, 1480, 1482, 1484, 1486, 1488, 1494, 1495, + 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1506, 1509, 1512, + 1513, 1517, 1519, 1521, 1523, 1527, 1528, 1530, 1534, 1536, + 1538, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, + 1550, 1551, 1552, 1553, 1556, 1557, 1562, 1565, 1568, 1569, + 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, + 1582, 1585, 1586, 1593, 1594, 1600, 1601, 1602, 1603, 1606, + 1607, 1608, 1609, 1612, 1613, 1617, 1620, 1623, 1626, 1629, + 1632, 1635, 1636, 1637, 1638, 1640, 1641, 1643, 1645, 1651, + 1655, 1657, 1659, 1661, 1665, 1666, 1669, 1670, 1673, 1674, + 1677, 1678, 1681, 1682, 1685, 1686, 1689, 1690, 1691, 1694, + 1707, 1712, 1713, 1717, 1718, 1721, 1726, 1729, 1730, 1731, + 1739, 1740, 1740, 1744, 1745, 1746, 1757, 1764, 1765, 1768, + 1769, 1772, 1773, 1774, 1775, 1776, 1778, 1779, 1780, 1781, + 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, + 1796, 1797, 1800, 1801, 1802, 1803, 1806, 1807, 1808, 1811, + 1812, 1813, 1816, 1817, 1818, 1819, 1820, 1823, 1824, 1825, + 1828, 1829, 1832, 1833, 1837, 1838, 1841, 1842, 1845, 1846, + 1849, 1850, 1851, 1852, 1855, 1856, 1857, 1858, 1859, 1860, + 1861, 1862, 1863, 1864, 1865, 1866, 1869, 1870, 1873, 1876, + 1878, 1880, 1884, 1885, 1887, 1889, 1892, 1893, 1894, 1896, + 1897, 1898, 1899, 1900, 1901, 1902, 1905, 1906, 1909, 1910, + 1913, 1916, 1917, 1918, 1919, 1920, 1923, 1924, 1925, 1926 }; #endif @@ -2831,7 +2830,7 @@ while (0) #ifndef YYPURE int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ +cgrammar_YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED @@ -2946,15 +2945,15 @@ yyparse(YYPARSE_PARAM_ARG) register int yystate; register int yyn; register short *yyssp; - register YYSTYPE *yyvsp; + register cgrammar_YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + cgrammar_YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + cgrammar_YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ @@ -2971,14 +2970,14 @@ yyparse(YYPARSE_PARAM_ARG) #ifdef YYPURE int yychar; - YYSTYPE yylval; + cgrammar_YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif - YYSTYPE yyval; /* the variable used to return */ + cgrammar_YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ @@ -3016,7 +3015,7 @@ yynewstate: { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; + cgrammar_YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; @@ -3071,7 +3070,7 @@ yynewstate: yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + yyvs = (cgrammar_YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED @@ -3262,16 +3261,16 @@ case 10: { uentry_checkDecl (); exprNode_free (yyvsp[0].expr); ; break;} case 11: -{ uentry_clearDecl (); /* evans 2002-02-08: okay to have a null statement */ ; +{ uentry_clearDecl (); lltok_free (yyvsp[0].tok); /* evans 2002-02-08: okay to have a null statement */ ; break;} case 12: { uentry_clearDecl (); ; break;} case 13: -{ checkConstant (yyvsp[-6].qtyp, yyvsp[-4].ntyp); ; +{ checkConstant (yyvsp[-6].qtyp, yyvsp[-4].ntyp); lltok_free2 (yyvsp[-7].tok, yyvsp[0].tok); ; break;} case 14: -{ checkValueConstant (yyvsp[-9].qtyp, yyvsp[-7].ntyp, yyvsp[-3].expr) ; ; +{ checkValueConstant (yyvsp[-9].qtyp, yyvsp[-7].ntyp, yyvsp[-3].expr); lltok_free3 (yyvsp[-10].tok, yyvsp[-5].tok, yyvsp[0].tok); ; break;} case 15: { context_enterFunctionHeader (); ; @@ -3280,6 +3279,7 @@ case 16: { declareStaticFunction (yyvsp[-2].ntyp); context_quietExitFunction (); context_exitFunctionHeader (); + lltok_free2 (yyvsp[-4].tok, yyvsp[0].tok); /*!*/ ; break;} case 17: @@ -3299,10 +3299,10 @@ case 21: { yyval.ntyp = idDecl_create (yyvsp[0].cname, qtype_unknown ()); ; break;} case 22: -{ yyval.ntyp = idDecl_expectFunction (yyvsp[-2].ntyp); ; +{ yyval.ntyp = idDecl_expectFunction (yyvsp[-2].ntyp); lltok_free2 (yyvsp[-4].tok, yyvsp[0].tok); ; break;} case 23: -{ yyval.ntyp = idDecl_replaceCtype (yyvsp[-2].ntyp, ctype_makeInnerArray (idDecl_getCtype (yyvsp[-2].ntyp))); ; +{ yyval.ntyp = idDecl_replaceCtype (yyvsp[-2].ntyp, ctype_makeInnerArray (idDecl_getCtype (yyvsp[-2].ntyp))); lltok_free2 (yyvsp[-1].tok, yyvsp[0].tok); ; break;} case 24: { @@ -3318,6 +3318,8 @@ case 24: { yyval.ntyp = idDecl_replaceCtype (yyvsp[-5].ntyp, ctype_makeInnerArray (idDecl_getCtype (yyvsp[-5].ntyp))); } + + lltok_free2 (yyvsp[-4].tok, yyvsp[-1].tok); ; break;} case 25: @@ -3333,6 +3335,7 @@ case 26: context_popLoc (); /*drl 7/25/01 added*/ setImplictfcnConstraints(); + lltok_free2 (yyvsp[-3].tok, yyvsp[-2].tok); ; break;} case 27: @@ -3344,16 +3347,19 @@ case 28: yyval.ntyp = idDecl_replaceCtype (yyvsp[-6].ntyp, ctype_makeFunction (idDecl_getCtype (yyvsp[-6].ntyp), yyvsp[-3].entrylist)); idDecl_addClauses (yyval.ntyp, yyvsp[0].funcclauselist); context_popLoc (); + lltok_free2 (yyvsp[-4].tok, yyvsp[-2].tok); ; break;} case 29: { yyval.ntyp = idDecl_create (yyvsp[0].cname, qtype_unknown ()); ; break;} case 30: -{ yyval.ntyp = idDecl_expectFunction (yyvsp[-2].ntyp); ; +{ yyval.ntyp = idDecl_expectFunction (yyvsp[-2].ntyp); lltok_free2 (yyvsp[-4].tok, yyvsp[0].tok); ; break;} case 31: -{ yyval.ntyp = idDecl_replaceCtype (yyvsp[-2].ntyp, ctype_makeInnerArray (idDecl_getCtype (yyvsp[-2].ntyp))); ; +{ yyval.ntyp = idDecl_replaceCtype (yyvsp[-2].ntyp, ctype_makeInnerArray (idDecl_getCtype (yyvsp[-2].ntyp))); + lltok_free2 (yyvsp[-1].tok, yyvsp[0].tok); + ; break;} case 32: { @@ -3370,6 +3376,7 @@ case 32: } yyval.ntyp = idDecl_replaceCtype (yyvsp[-5].ntyp, ctype_makeInnerFixedArray (idDecl_getCtype (yyvsp[-5].ntyp), value)); + lltok_free2 (yyvsp[-4].tok, yyvsp[-1].tok); ; break;} case 33: @@ -3383,6 +3390,7 @@ case 34: yyval.ntyp = idDecl_replaceCtype (yyvsp[-5].ntyp, ct); idDecl_addClauses (yyval.ntyp, yyvsp[0].funcclauselist); context_popLoc (); + lltok_free2 (yyvsp[-3].tok, yyvsp[-2].tok); ; break;} case 35: @@ -3394,6 +3402,8 @@ case 36: yyval.ntyp = idDecl_replaceCtype (yyvsp[-6].ntyp, ctype_makeFunction (idDecl_getCtype (yyvsp[-6].ntyp), yyvsp[-3].entrylist)); idDecl_addClauses (yyval.ntyp, yyvsp[0].funcclauselist); context_popLoc (); + lltok_free (yyvsp[-4].tok); + /*!! lltok_free2 ($3, $5); */ ; break;} case 37: @@ -3403,45 +3413,51 @@ case 38: { clearCurrentParams (); ; break;} case 39: -{ declareCIter (yyvsp[-8].cname, yyvsp[-6].entrylist); ; +{ declareCIter (yyvsp[-8].cname, yyvsp[-6].entrylist); + lltok_free3 (yyvsp[-9].tok, yyvsp[-7].tok, yyvsp[-5].tok); + ; break;} case 40: -{ exprNode_checkMacroBody (yyvsp[-1].expr); ; +{ exprNode_checkMacroBody (yyvsp[-1].expr); lltok_free2 (yyvsp[-2].tok, yyvsp[0].tok); ; break;} case 41: -{ exprNode_checkIterBody (yyvsp[-1].expr); ; +{ exprNode_checkIterBody (yyvsp[-1].expr); lltok_free2 (yyvsp[-2].tok, yyvsp[0].tok); ; break;} case 42: -{ exprNode_checkIterEnd (yyvsp[-1].expr); ; +{ exprNode_checkIterEnd (yyvsp[-1].expr); lltok_free2 (yyvsp[-2].tok, yyvsp[0].tok);; break;} case 43: -{ exprChecks_checkEmptyMacroBody (); ; +{ exprChecks_checkEmptyMacroBody (); lltok_free2 (yyvsp[-1].tok, yyvsp[0].tok); ; break;} case 44: { clabstract_declareFunction (yyvsp[0].ntyp); ; break;} case 45: -{ yyval.msconstraint = metaStateConstraint_create (yyvsp[-2].msspec, yyvsp[0].msexpr); ; +{ yyval.msconstraint = metaStateConstraint_create (yyvsp[-2].msspec, yyvsp[0].msexpr); lltok_free (yyvsp[-1].tok); ; break;} case 46: { cscanner_expectingMetaStateName (); ; break;} case 47: { cscanner_clearExpectingMetaStateName (); - yyval.msspec = metaStateSpecifier_create (yyvsp[-3].sr, yyvsp[0].msinfo); ; + yyval.msspec = metaStateSpecifier_create (yyvsp[-3].sr, yyvsp[0].msinfo); + lltok_free (yyvsp[-1].tok); + ; break;} case 48: { cscanner_expectingMetaStateName (); ; break;} case 49: { cscanner_clearExpectingMetaStateName (); - yyval.msspec = metaStateSpecifier_createElipsis (yyvsp[0].msinfo); ; + yyval.msspec = metaStateSpecifier_createElipsis (yyvsp[0].msinfo); + lltok_free2 (yyvsp[-3].tok, yyvsp[-1].tok); + ; break;} case 50: { yyval.msexpr = metaStateExpression_create (yyvsp[0].msspec); ; break;} case 51: -{ yyval.msexpr = metaStateExpression_createMerge (yyvsp[-2].msspec, yyvsp[0].msexpr); ; +{ yyval.msexpr = metaStateExpression_createMerge (yyvsp[-2].msspec, yyvsp[0].msexpr); lltok_free (yyvsp[-1].tok); ; break;} case 55: { yyval.conL = constraintList_add (yyvsp[0].conL, yyvsp[-2].con); ; @@ -3854,16 +3870,17 @@ case 194: { yyval.expr = yyvsp[0].expr; ; break;} case 195: -{ yyval.cstringlist = cstringList_add (yyvsp[-2].cstringlist, yyvsp[0].cname); ; +{ yyval.cstringlist = cstringList_add (yyvsp[-2].cstringlist, yyvsp[0].cname); lltok_free (yyvsp[-1].tok); ; break;} case 196: -{ yyval.cstringlist = yyvsp[-3].cstringlist; ; +{ yyval.cstringlist = yyvsp[-3].cstringlist; lltok_free2 (yyvsp[-2].tok, yyvsp[0].tok); ; break;} case 197: { yyval.cstringlist = cstringList_single (yyvsp[0].cname); ; break;} case 198: -{ yyval.expr = exprNode_offsetof (yyvsp[-5].qtyp, yyvsp[-2].cstringlist); ; +{ yyval.expr = exprNode_offsetof (yyvsp[-5].qtyp, yyvsp[-2].cstringlist); + lltok_free3 (yyvsp[-8].tok, yyvsp[-6].tok, yyvsp[-3].tok); lltok_free (yyvsp[-1].tok); ; break;} case 199: { context_setProtectVars (); ; @@ -3872,19 +3889,19 @@ case 200: { context_sizeofReleaseVars (); yyval.expr = yyvsp[0].expr; ; break;} case 201: -{ yyval.expr = exprNode_sizeofType (yyvsp[-1].qtyp); ; +{ yyval.expr = exprNode_sizeofType (yyvsp[-1].qtyp); lltok_free3 (yyvsp[-3].tok, yyvsp[-2].tok, yyvsp[0].tok); ; break;} case 202: -{ yyval.expr = exprNode_sizeofExpr (yyvsp[0].expr); ; +{ yyval.expr = exprNode_sizeofExpr (yyvsp[0].expr); lltok_free (yyvsp[-1].tok); ; break;} case 203: -{ yyval.expr = exprNode_alignofType (yyvsp[-1].qtyp); ; +{ yyval.expr = exprNode_alignofType (yyvsp[-1].qtyp); lltok_free3 (yyvsp[-3].tok, yyvsp[-2].tok, yyvsp[0].tok); ; break;} case 204: -{ yyval.expr = exprNode_alignofExpr (yyvsp[0].expr); ; +{ yyval.expr = exprNode_alignofExpr (yyvsp[0].expr); lltok_free (yyvsp[-1].tok); ; break;} case 206: -{ yyval.expr = exprNode_cast (yyvsp[-3].tok, yyvsp[0].expr, yyvsp[-2].qtyp); ; +{ yyval.expr = exprNode_cast (yyvsp[-3].tok, yyvsp[0].expr, yyvsp[-2].qtyp); lltok_free (yyvsp[-1].tok); ; break;} case 208: { yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; @@ -4084,10 +4101,10 @@ case 279: { yyval.expr = exprNode_concat (yyvsp[-3].expr, yyvsp[0].expr); ; break;} case 281: -{ yyval.expr = exprNode_makeInitBlock (yyvsp[-2].tok, yyvsp[-1].exprlist); ; +{ yyval.expr = exprNode_makeInitBlock (yyvsp[-2].tok, yyvsp[-1].exprlist); lltok_free (yyvsp[0].tok); ; break;} case 282: -{ yyval.expr = exprNode_makeInitBlock (yyvsp[-3].tok, yyvsp[-2].exprlist); ; +{ yyval.expr = exprNode_makeInitBlock (yyvsp[-3].tok, yyvsp[-2].exprlist); lltok_free2 (yyvsp[-1].tok, yyvsp[0].tok); ; break;} case 283: { yyval.expr = exprNode_undefined; ; @@ -4561,7 +4578,7 @@ case 435: { qtype qt = qtype_unknown (); qtype_adjustPointers (yyvsp[-1].pointers, qt); - yyval.ntyp = idDecl_create (cstring_copy (LastIdentifier ()), qt); + yyval.ntyp = idDecl_create (cstring_copy (cscanner_observeLastIdentifier ()), qt); ; break;} case 436: @@ -4976,7 +4993,7 @@ case 596: } else { - yyval.expr = exprNode_iterNewId (cstring_copy (LastIdentifier ())); + yyval.expr = exprNode_iterNewId (cstring_copy (cscanner_observeLastIdentifier ())); } ; break;} @@ -5486,7 +5503,7 @@ void yyerror (/*@unused@*/ char *s) } } - swallowMacro (); + cscanner_swallowMacro (); context_exitAllClausesQuiet (); } else diff --git a/src/cgrammar.y b/src/cgrammar.y index da66257..0eba07e 100644 --- a/src/cgrammar.y +++ b/src/cgrammar.y @@ -47,7 +47,6 @@ /*@=allmacros@*/ extern int yylex (); -extern void swallowMacro (void); extern void yyerror (char *); # include "splintMacros.nf" @@ -336,20 +335,21 @@ externalDef | iterDecl { uentry_clearDecl (); } | macroDef { uentry_clearDecl (); } | initializer { uentry_checkDecl (); exprNode_free ($1); } - | TSEMI { uentry_clearDecl (); /* evans 2002-02-08: okay to have a null statement */ } + | TSEMI { uentry_clearDecl (); lltok_free ($1); /* evans 2002-02-08: okay to have a null statement */ } | error { uentry_clearDecl (); } constantDecl : QCONSTANT completeTypeSpecifier NotType namedDecl NotType optSemi IsType QENDMACRO - { checkConstant ($2, $4); } + { checkConstant ($2, $4); lltok_free2 ($1, $8); } | QCONSTANT completeTypeSpecifier NotType namedDecl NotType TASSIGN IsType init optDeclarators optSemi QENDMACRO - { checkValueConstant ($2, $4, $8) ; } + { checkValueConstant ($2, $4, $8); lltok_free3 ($1, $6, $11); } fcnDecl : QFUNCTION { context_enterFunctionHeader (); } plainFcn optSemi QENDMACRO { declareStaticFunction ($3); context_quietExitFunction (); context_exitFunctionHeader (); + lltok_free2 ($1, $5); /*!*/ } plainFcn @@ -370,9 +370,9 @@ plainNamedDecl namedDeclBase : newId { $$ = idDecl_create ($1, qtype_unknown ()); } | IsType TLPAREN NotType namedDecl IsType TRPAREN - { $$ = idDecl_expectFunction ($4); } + { $$ = idDecl_expectFunction ($4); lltok_free2 ($2, $6); } | namedDeclBase TLSQBR TRSQBR - { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); } + { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); lltok_free2 ($2, $3); } | namedDeclBase TLSQBR IsType constantExpr TRSQBR NotType { exprNode_findValue ($4); @@ -387,6 +387,8 @@ namedDeclBase { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); } + + lltok_free2 ($2, $5); } | namedDeclBase PushType TLPAREN TRPAREN { setCurrentParams (uentryList_missingParams); } @@ -400,6 +402,7 @@ namedDeclBase context_popLoc (); /*drl 7/25/01 added*/ setImplictfcnConstraints(); + lltok_free2 ($3, $4); } | namedDeclBase PushType TLPAREN genericParamList TRPAREN { setCurrentParams ($4); } @@ -409,14 +412,17 @@ namedDeclBase $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4)); idDecl_addClauses ($$, $7); context_popLoc (); + lltok_free2 ($3, $5); } plainNamedDeclBase : newId { $$ = idDecl_create ($1, qtype_unknown ()); } | IsType TLPAREN NotType plainNamedDecl IsType TRPAREN - { $$ = idDecl_expectFunction ($4); } + { $$ = idDecl_expectFunction ($4); lltok_free2 ($2, $6); } | plainNamedDeclBase TLSQBR TRSQBR - { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); } + { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); + lltok_free2 ($2, $3); + } | plainNamedDeclBase TLSQBR IsType constantExpr TRSQBR NotType { int value; @@ -432,6 +438,7 @@ plainNamedDeclBase } $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1), value)); + lltok_free2 ($2, $5); } | plainNamedDeclBase PushType TLPAREN TRPAREN { setCurrentParams (uentryList_missingParams); } @@ -443,6 +450,7 @@ plainNamedDeclBase $$ = idDecl_replaceCtype ($1, ct); idDecl_addClauses ($$, $6); context_popLoc (); + lltok_free2 ($3, $4); } | plainNamedDeclBase PushType TLPAREN genericParamList TRPAREN { setCurrentParams ($4); } @@ -452,38 +460,46 @@ plainNamedDeclBase $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4)); idDecl_addClauses ($$, $7); context_popLoc (); + lltok_free ($3); + /*!! lltok_free2 ($3, $5); */ } iterDecl : QITER newId TLPAREN genericParamList TRPAREN { setCurrentParams ($4); } functionClausesPlain { clearCurrentParams (); } optSemi QENDMACRO - { declareCIter ($2, $4); } + { declareCIter ($2, $4); + lltok_free3 ($1, $3, $5); + } macroDef - : LLMACRO macroBody TENDMACRO { exprNode_checkMacroBody ($2); } - | LLMACROITER iterBody TENDMACRO { exprNode_checkIterBody ($2); } - | LLMACROEND endBody TENDMACRO { exprNode_checkIterEnd ($2); } - | LLMACRO TENDMACRO /* no stmt */ { exprChecks_checkEmptyMacroBody (); } + : LLMACRO macroBody TENDMACRO { exprNode_checkMacroBody ($2); lltok_free2 ($1, $3); } + | LLMACROITER iterBody TENDMACRO { exprNode_checkIterBody ($2); lltok_free2 ($1, $3); } + | LLMACROEND endBody TENDMACRO { exprNode_checkIterEnd ($2); lltok_free2 ($1, $3);} + | LLMACRO TENDMACRO /* no stmt */ { exprChecks_checkEmptyMacroBody (); lltok_free2 ($1, $2); } fcnDefHdr : fcnDefHdrAux { clabstract_declareFunction ($1); } metaStateConstraint : metaStateSpecifier TASSIGN metaStateExpression - { $$ = metaStateConstraint_create ($1, $3); } + { $$ = metaStateConstraint_create ($1, $3); lltok_free ($2); } metaStateSpecifier : BufConstraintSrefExpr { cscanner_expectingMetaStateName (); } TCOLON metaStateName { cscanner_clearExpectingMetaStateName (); - $$ = metaStateSpecifier_create ($1, $4); } + $$ = metaStateSpecifier_create ($1, $4); + lltok_free ($3); + } | CTOK_ELIPSIS { cscanner_expectingMetaStateName (); } TCOLON metaStateName { cscanner_clearExpectingMetaStateName (); - $$ = metaStateSpecifier_createElipsis ($4); } + $$ = metaStateSpecifier_createElipsis ($4); + lltok_free2 ($1, $3); + } metaStateExpression : metaStateSpecifier { $$ = metaStateExpression_create ($1); } -| metaStateSpecifier TBAR metaStateExpression { $$ = metaStateExpression_createMerge ($1, $3); } +| metaStateSpecifier TBAR metaStateExpression { $$ = metaStateExpression_createMerge ($1, $3); lltok_free ($2); } metaStateName : METASTATE_NAME @@ -831,29 +847,30 @@ unaryExpr | offsetofExpr { $$ = $1; } fieldDesignator - : fieldDesignator TDOT newId { $$ = cstringList_add ($1, $3); } - | fieldDesignator TLSQBR expr TRSQBR { $$ = $1; } + : fieldDesignator TDOT newId { $$ = cstringList_add ($1, $3); lltok_free ($2); } + | fieldDesignator TLSQBR expr TRSQBR { $$ = $1; lltok_free2 ($2, $4); } /* evans 2002-07-02: offsetof designators can use array indexes */ | newId { $$ = cstringList_single ($1); } offsetofExpr : COFFSETOF IsType TLPAREN typeExpression NotType TCOMMA fieldDesignator TRPAREN IsType - { $$ = exprNode_offsetof ($4, $7); } + { $$ = exprNode_offsetof ($4, $7); + lltok_free3 ($1, $3, $6); lltok_free ($8); } sizeofExpr : IsType { context_setProtectVars (); } sizeofExprAux { context_sizeofReleaseVars (); $$ = $3; } sizeofExprAux - : CSIZEOF TLPAREN typeExpression TRPAREN { $$ = exprNode_sizeofType ($3); } - | CSIZEOF unaryExpr { $$ = exprNode_sizeofExpr ($2); } - | CALIGNOF TLPAREN typeExpression TRPAREN { $$ = exprNode_alignofType ($3); } - | CALIGNOF unaryExpr { $$ = exprNode_alignofExpr ($2); } + : CSIZEOF TLPAREN typeExpression TRPAREN { $$ = exprNode_sizeofType ($3); lltok_free3 ($1, $2, $4); } + | CSIZEOF unaryExpr { $$ = exprNode_sizeofExpr ($2); lltok_free ($1); } + | CALIGNOF TLPAREN typeExpression TRPAREN { $$ = exprNode_alignofType ($3); lltok_free3 ($1, $2, $4); } + | CALIGNOF unaryExpr { $$ = exprNode_alignofExpr ($2); lltok_free ($1); } castExpr : unaryExpr | TLPAREN typeExpression TRPAREN castExpr - { $$ = exprNode_cast ($1, $4, $2); } + { $$ = exprNode_cast ($1, $4, $2); lltok_free ($3); } timesExpr : castExpr @@ -1027,8 +1044,8 @@ optDeclarators init : assignExpr - | TLBRACE initList TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); } - | TLBRACE initList TCOMMA TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); } + | TLBRACE initList TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); lltok_free ($3); } + | TLBRACE initList TCOMMA TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); lltok_free2 ($3, $4); } | designation init { $$ = exprNode_undefined; } /* @@ -1365,7 +1382,7 @@ optNamedDecl { qtype qt = qtype_unknown (); qtype_adjustPointers ($1, qt); - $$ = idDecl_create (cstring_copy (LastIdentifier ()), qt); + $$ = idDecl_create (cstring_copy (cscanner_observeLastIdentifier ()), qt); } | pointers optNamedDecl { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); } @@ -1734,7 +1751,7 @@ iterArgExpr } else { - $$ = exprNode_iterNewId (cstring_copy (LastIdentifier ())); + $$ = exprNode_iterNewId (cstring_copy (cscanner_observeLastIdentifier ())); } } | NEW_IDENTIFIER { $$ = exprNode_iterNewId ($1); } @@ -1946,7 +1963,7 @@ void yyerror (/*@unused@*/ char *s) } } - swallowMacro (); + cscanner_swallowMacro (); context_exitAllClausesQuiet (); } else diff --git a/src/clabstract.c b/src/clabstract.c index a100791..d5a1c37 100644 --- a/src/clabstract.c +++ b/src/clabstract.c @@ -31,10 +31,7 @@ # include "splintMacros.nf" # include "llbasic.h" # include "cgrammar.h" - -# ifndef NOLCL # include "usymtab_interface.h" -# endif # include "structNames.h" # include "nameChecks.h" diff --git a/src/constraintTerm.c b/src/constraintTerm.c index 868c9d5..28f2de5 100644 --- a/src/constraintTerm.c +++ b/src/constraintTerm.c @@ -532,7 +532,7 @@ bool constraintTerm_similar (constraintTerm term1, constraintTerm term2) } } -void constraintTerm_dump ( /*@observer@*/ constraintTerm t, FILE *f) +void constraintTerm_dump (/*@observer@*/ constraintTerm t, FILE *f) { fileloc loc; constraintTermValue value; @@ -552,8 +552,7 @@ void constraintTerm_dump ( /*@observer@*/ constraintTerm t, FILE *f) case EXPRNODE: u = exprNode_getUentry(t->value.expr); - fprintf(f, "%s\n", cstring_toCharsSafe( uentry_rawName (u) ) - ); + fprintf (f, "%s\n", cstring_toCharsSafe (uentry_rawName (u))); break; case SREF: @@ -566,7 +565,7 @@ void constraintTerm_dump ( /*@observer@*/ constraintTerm t, FILE *f) { fprintf(f, "Result\n"); } - else if (sRef_isParam (s ) ) + else if (sRef_isParam (s)) { int param; ctype ct; @@ -588,7 +587,7 @@ void constraintTerm_dump ( /*@observer@*/ constraintTerm t, FILE *f) else { u = sRef_getUentry(s); - fprintf(f, "%s\n", cstring_toCharsSafe(uentry_rawName (u) ) ); + fprintf (f, "%s\n", cstring_toCharsSafe (uentry_rawName (u))); } } diff --git a/src/context.c b/src/context.c index f2d8b97..6d521cb 100644 --- a/src/context.c +++ b/src/context.c @@ -36,10 +36,7 @@ # include "splintMacros.nf" # include "llbasic.h" -# ifndef NOLCL # include "usymtab_interface.h" -# endif - # include "exprChecks.h" # include "filelocStack.h" # include "llmain.h" @@ -53,7 +50,7 @@ extern /*@external@*/ int mtdebug; typedef struct { cstring file; - typeIdSet daccess ; + typeIdSet daccess; } maccesst; typedef enum { @@ -476,14 +473,12 @@ context_exitMTfile (void) gc.kind = CX_GLOBAL; } -# ifndef NOLCL void context_enterLCLfile (void) { gc.kind = CX_LCL; gc.facct = typeIdSet_emptySet (); } -# endif static void addModuleAccess (/*@only@*/ cstring fname, typeIdSet mods) @@ -540,7 +535,6 @@ insertModuleAccess (cstring fname, typeId t) addModuleAccess (cstring_copy (fname), typeIdSet_single (t)); } -# ifndef NOLCL void context_exitLCLfile (void) { @@ -557,7 +551,6 @@ context_exitLCLfile (void) gc.kind = CX_GLOBAL; gc.facct = typeIdSet_emptySet (); } -# endif void context_dumpModuleAccess (FILE *fout) @@ -4330,17 +4323,29 @@ void context_destroyMod (void) /*@globals killed gc@*/ { + int i; setCodePoint (); ctype_destroyMod (); + /* setCodePoint (); usymtab_free (); setCodePoint (); + */ + fileTable_free (gc.ftab); + gc.ftab = fileTable_undefined; + filelocStack_free (gc.locstack); setCodePoint (); - gc.ftab = fileTable_undefined; macrocache_free (gc.mc); + + /* evans 2002-07-12: not reported because of reldef */ + for (i = 0; i < gc.nmods; i++) + { + cstring_free (gc.moduleaccess[i].file); + } + sfree (gc.moduleaccess); setCodePoint (); @@ -4361,6 +4366,8 @@ context_destroyMod (void) globSet_free (gc.globs_used); metaStateTable_free (gc.stateTable); annotationTable_free (gc.annotTable); + + } /* @@ -4392,12 +4399,10 @@ bool context_msgStrictOps (void) return gc.flags [FLG_STRICTOPS]; } -# ifndef NOLCL bool context_msgLh (void) { return gc.flags [FLG_DOLH]; } -# endif void context_pushLoc (void) { @@ -4457,12 +4462,10 @@ int context_getExpect (void) return (context_getValue (FLG_EXPECT)); } -# ifndef NOLCL int context_getLCLExpect (void) { return (context_getValue (FLG_LCLEXPECT)); } -# endif int context_getLimit (void) { @@ -4564,7 +4567,6 @@ cstring context_getMerge (void) return context_getString (FLG_MERGE); } -# ifndef NOLCL bool context_inLCLLib (void) { return (gc.kind == CX_LCLLIB); @@ -4584,7 +4586,6 @@ void context_leaveImport (void) { gc.inimport = FALSE; } -# endif bool context_inMacro (void) { @@ -4613,7 +4614,6 @@ int context_getSpecLinesProcessed (void) return (gc.speclinesprocessed); } -# ifndef NOLCL void context_processedSpecLine (void) { gc.speclinesprocessed++; @@ -4622,8 +4622,8 @@ void context_processedSpecLine (void) void context_resetSpecLines (void) { gc.speclinesprocessed = 0; + } -# endif bool context_inGlobalContext (void) { diff --git a/src/cpperror.c b/src/cpperror.c index 73a26d9..5d76f99 100644 --- a/src/cpperror.c +++ b/src/cpperror.c @@ -215,7 +215,7 @@ cppReader_getLoc (cppReader *pfile) { cppBuffer *ip = cppReader_fileBuffer (pfile); - if (ip != NULL) + if (ip != NULL && ip->buf != NULL) { int line, col; cstring fname = ip->nominal_fname; diff --git a/src/cpplib.c b/src/cpplib.c index 7534384..5aa50b9 100644 --- a/src/cpplib.c +++ b/src/cpplib.c @@ -822,11 +822,11 @@ cppReader_getIncludePath () } void -cppReader_addIncludeChain (cppReader *pfile, struct file_name_list *dir) +cppReader_addIncludeChain (cppReader *pfile, /*@only@*/ struct file_name_list *dir) { struct cppOptions *opts = CPPOPTIONS (pfile); - if (dir == 0) + if (dir == NULL) { return; } @@ -960,7 +960,7 @@ cppReader_nullUnderflow (/*@unused@*/ cppReader *pfile) void cppReader_nullCleanup (/*@unused@*/ cppBuffer *pbuf, - /*@unused@*/ cppReader *pfile) + /*@unused@*/ cppReader *pfile) { ; } @@ -2242,7 +2242,7 @@ create_definition (/*@exposed@*/ char *buf, char *limit, if (!is_idstart[(int) *bp]) { cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("invalid character in macro parameter name")); + cstring_makeLiteralTemp ("Invalid character in macro parameter name")); } /* Find the end of the arg name. */ @@ -3106,7 +3106,7 @@ update_position (cppBuffer *pbuf) void cppBuffer_getLineAndColumn (/*@null@*/ cppBuffer *pbuf, /*@out@*/ int *linep, - /*@null@*/ /*@out@*/ int *colp) + /*@null@*/ /*@out@*/ int *colp) { int dummy; @@ -6748,8 +6748,8 @@ static cstring read_filename_string (int ch, /*:open:*/ FILE *f) struct file_name_map_list { - struct file_name_map_list *map_list_next; - cstring map_list_name; + /*@only@*/ struct file_name_map_list *map_list_next; + /*@only@*/ cstring map_list_name; /*@null@*/ struct file_name_map *map_list_map; }; @@ -7060,7 +7060,7 @@ finclude (cppReader *pfile, int f, else if (S_ISDIR (st_mode)) { cppReader_error (pfile, - message ("Directory specified in #include: %s", fname)); + message ("Directory specified where file is expected: %s", fname)); check (close (f) == 0); return 0; } @@ -7157,8 +7157,12 @@ cppReader_finish (/*@unused@*/ cppReader *pfile) This is the cppReader 'finalizer' or 'destructor' (in C++ terminology). */ void -cppCleanup (cppReader *pfile) +cppCleanup (/*@special@*/ cppReader *pfile) + /*@uses pfile@*/ + /*@releases pfile@*/ { + DPRINTF (("cppCleanup!")); + while (CPPBUFFER (pfile) != cppReader_nullBuffer (pfile)) { (void) cppReader_popBuffer (pfile); @@ -7187,6 +7191,25 @@ cppCleanup (cppReader *pfile) sfree (temp); } + /* evans 2002-07-12 */ + while (pfile->opts->map_list != NULL) + { + struct file_name_map_list *temp = pfile->opts->map_list; + pfile->opts->map_list = pfile->opts->map_list->map_list_next; + cstring_free (temp->map_list_name); + sfree (temp); + } + + while (pfile->opts->include != NULL) + { + struct file_name_list *temp = pfile->opts->include; + pfile->opts->include = pfile->opts->include->next; + /* cstring_free (temp->fname); */ + sfree (temp); + } + + sfree (pfile->opts); + pfile->opts = NULL; cppReader_hashCleanup (); } @@ -7506,6 +7529,7 @@ void cpplib_initializeReader (cppReader *pfile) /* Must be done after library is cppReader_appendIncludeChain (pfile, opts->before_system, opts->last_before_system); + opts->first_system_include = opts->before_system; /* Unless -fnostdinc, @@ -7552,11 +7576,12 @@ void cpplib_initializeReader (cppReader *pfile) /* Must be done after library is nlist->c_system_include_path = !p->cxx_aware; nlist->got_name_map = 0; - cppReader_addIncludeChain (pfile, nlist); if (opts->first_system_include == 0) { opts->first_system_include = nlist; } + + cppReader_addIncludeChain (pfile, nlist); } } } @@ -7577,12 +7602,12 @@ void cpplib_initializeReader (cppReader *pfile) /* Must be done after library is nlist->got_name_map = 0; nlist->next = NULL; - cppReader_addIncludeChain (pfile, nlist); - - if (opts->first_system_include == 0) + if (opts->first_system_include == NULL) { - opts->first_system_include = nlist; + opts->first_system_include = nlist; } + + cppReader_addIncludeChain (pfile, nlist); } } sfree (default_prefix); @@ -7592,7 +7617,7 @@ void cpplib_initializeReader (cppReader *pfile) /* Must be done after library is cppReader_appendIncludeChain (pfile, opts->after_include, opts->last_after_include); - if (opts->first_system_include == 0) + if (opts->first_system_include == NULL) { opts->first_system_include = opts->after_include; } diff --git a/src/cppmain.c b/src/cppmain.c index a01bf67..991ed85 100644 --- a/src/cppmain.c +++ b/src/cppmain.c @@ -89,6 +89,12 @@ void cppReader_initMod () /*@-compdef@*/ /* g_cppState is not yet innitialized */ } /*@=compdef@*/ +void cppReader_destroyMod () + /*@globals killed g_cppState@*/ +{ + cppCleanup (&g_cppState); +} + void cppReader_initialize () { cpplib_initializeReader (&g_cppState); diff --git a/src/cprim.c b/src/cprim.c index 4a0210f..9f75119 100644 --- a/src/cprim.c +++ b/src/cprim.c @@ -109,8 +109,16 @@ cprim_closeEnoughAux (cprim c1, cprim c2, bool deep) if (context_getFlag (FLG_MATCHANYINTEGRAL) || context_getFlag (FLG_IGNOREQUALS)) { - return (cprim_isAnyInt (c2) - || (cprim_isAnyChar (c2) && context_msgCharInt ())); + if (context_getFlag (FLG_IGNORESIGNS)) + { + return (cprim_isAnyUnsignedInt (c2) + || (cprim_isUnsignedChar (c2) && context_msgCharInt ())); + } + else + { + return (cprim_isAnyInt (c2) + || (cprim_isAnyChar (c2) && context_msgCharInt ())); + } } else if (context_getFlag (FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL)) { diff --git a/src/cscanner.l b/src/cscanner.l index 1a8e618..cb1e7c4 100644 --- a/src/cscanner.l +++ b/src/cscanner.l @@ -92,7 +92,7 @@ static char savechar = '\0'; /*@notfunction@*/ # define yyinput() (incColumn (), getc (yyin)) -static /*@owned@*/ cstring lastidprocessed = cstring_undefined; +static /*@owned@*/ cstring s_lastidprocessed = cstring_undefined; static int lminput (void); static int tokLength = 0; static bool inSpecPart = FALSE; @@ -107,9 +107,9 @@ static long processDec (void); static long processHex (void); static long processOctal (void); static int processIdentifier (/*@only@*/ cstring) - /*@globals undef lastidprocessed@*/ ; + /*@globals s_lastidprocessed@*/ ; static bool processHashIdentifier (/*@only@*/ cstring) - /*@globals undef lastidprocessed@*/ ; + /*@globals s_lastidprocessed@*/ ; static int processSpec (int); static bool handleSpecial (char *); @@ -588,6 +588,58 @@ L'(\\.|[^\\'])+' { setTokLengthT (mstring_length (yytext)); } %% +/* +** Resets flags set by flex.head. +*/ + +/*@=allmacros@*/ +/*@=pred@*/ +/*@=globstate@*/ +/*@=null@*/ +/*@=boolint@*/ +/*@=charint@*/ +/*@=macrospec@*/ +/*@=macroredef@*/ +/*@=exitarg@*/ +/*@=compdef@*/ +/*@=uniondef@*/ +/*@=ignorequals@*/ +/*@=noreturn@*/ +/*@=mustfree@*/ +/*@=compdestroy@*/ +/*@=branchstate@*/ +/*@=unreachable@*/ +/*@=varuse@*/ +/*@=fcnuse@*/ +/*@=exportlocal@*/ +/*@=evalorderuncon@*/ +/*@=exportheader@*/ +/*@=redecl@*/ +/*@=loopswitchbreak@*/ +/*@=switchswitchbreak@*/ +/*@=sizeoftype@*/ +/*@=czechfcns@*/ +/*@=noparams@*/ +/*@=ansireserved@*/ +/*@=ifblock@*/ +/*@=whileblock@*/ +/*@=forblock@*/ +/*@=elseifcomplete@*/ +/*@=ptrnegate@*/ +/*@=onlytrans@*/ +/*@=temptrans@*/ +/*@=immediatetrans@*/ +/*@=namechecks@*/ +/*@=matchanyintegral@*/ +/*@=statictrans@*/ +/*@=compmempass@*/ +/*@=forempty@*/ +/*@=evalorder@*/ +/*@=retalias@*/ +/*@=redecl@*/ +/*@=retvalother@*/ +/*@=exportheader@*/ + struct skeyword { /*@null@*/ /*@observer@*/ char *name; @@ -599,7 +651,7 @@ struct skeyword ** grammar proper. */ -struct skeyword s_parsetable[] = { +static struct skeyword s_parsetable[] = { { "modifies", QMODIFIES } , { "globals", QGLOBALS } , { "alt", QALT } , @@ -628,7 +680,7 @@ struct skeyword s_parsetable[] = { ** token-specific text. */ -struct skeyword s_keytable[] = { +static struct skeyword s_keytable[] = { { "anytype", QANYTYPE } , { "integraltype", QINTEGRALTYPE } , { "unsignedintegraltype", QUNSIGNEDINTEGRALTYPE } , @@ -718,7 +770,7 @@ static bool isArtificial (cstring s) || cstring_equalLit (s, "alt")); } -void swallowMacro (void) +void cscanner_swallowMacro (void) { int i; bool skipnext = FALSE; @@ -727,7 +779,6 @@ void swallowMacro (void) { char c = (char) i; - if (c == '\\') { skipnext = TRUE; @@ -744,6 +795,10 @@ void swallowMacro (void) return; } } + else + { + ; + } } if (i != EOF) @@ -859,10 +914,12 @@ static int tokenMacroCode (cstring s) setArgsUsed (); return SKIPTOK; } - - return s_keytable[i].token; + else + { + return s_keytable[i].token; + } } - + i++; } @@ -915,6 +972,10 @@ static int returnInt (ctype ct, long i) { c = context_typeofOne (); } + else + { + ; + } } yylval.expr = exprNode_numLiteral (c, cstring_fromChars (yytext), @@ -943,7 +1004,7 @@ static int ninput () return c; } -static char macro_nextChar () +static char macro_nextChar (void) { static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE; int ic; @@ -1040,6 +1101,11 @@ static char macro_nextChar () lmsavechar (c2); } } + else + { + ; + } + return c; } @@ -1047,7 +1113,7 @@ static char macro_nextChar () ** keeps semantic comments */ -static char macro_nextCharC () +static char macro_nextCharC (void) { static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE; char c; @@ -1128,6 +1194,11 @@ static char macro_nextCharC () lmsavechar (c2); } } + else /* normal character */ + { + ; + } + return c; } @@ -1136,7 +1207,7 @@ static char macro_nextCharC () ** returns first non-whitespace character */ -static char skip_whitespace () +static char skip_whitespace (void) { char c; @@ -1166,7 +1237,7 @@ static void handleMacro () { int i; - for (i = 0; i < ((c - '0') + 1); i++) + for (i = 0; i < (((int) (c - '0')) + 1); i++) { mac = cstring_appendChar (mac, ' '); } @@ -1247,13 +1318,13 @@ static bool processMacro (void) { c = macro_nextChar (); } - unput (c); + unput ((int) c); } if (c == '\n') { emptyMacro = TRUE; - unput (c); + unput ((int) c); } c = oldc; @@ -1377,6 +1448,10 @@ static bool processMacro (void) fileloc_unparse (oloc)), loc); } + else + { + /* No warning */ + } } context_enterConstantMacro (e2); @@ -1454,7 +1529,7 @@ static bool processMacro (void) "typedef should be used instead."), g_currentloc); - swallowMacro (); + cscanner_swallowMacro (); /* Must exit scope (not sure why a new scope was entered?) */ usymtab_quietExitScope (g_currentloc); uentry_setDefined (e2, g_currentloc); @@ -1707,13 +1782,12 @@ static bool processMacro (void) static bool handleSpecial (char *yyt) { - char *l = mstring_create (MAX_NAME_LENGTH); + char *l; /* !! = mstring_create (MAX_NAME_LENGTH); */ int lineno = 0; char c; char *ol; cstring olc; - - int len_yyt; + size_t len_yyt; len_yyt = strlen (yyt +1) ; @@ -1733,7 +1807,7 @@ static bool handleSpecial (char *yyt) if (cstring_equalPrefixLit (olc, "pragma")) { - char *pname = mstring_create (longUnsigned_fromInt (MAX_PRAGMA_LEN)); + char *pname = mstring_create (size_fromInt (MAX_PRAGMA_LEN)); char *opname = pname; char *ptr = ol + 6; /* pragma is six characters, plus space */ int len = 0; @@ -1919,7 +1993,7 @@ static bool handleSpecial (char *yyt) return FALSE; } -static int handleLlSpecial () +static int handleLlSpecial (void) { bool hasnl = FALSE; int ic; @@ -1947,7 +2021,7 @@ static int handleLlSpecial () { ic = ninput (); - llassert (ic == AFTER_COMMENT_MARKER[1]); + llassert (ic == (int) AFTER_COMMENT_MARKER[1]); if (*s == '\0') { @@ -1980,7 +2054,7 @@ static int handleLlSpecial () charsread++; while (((ic = ninput ()) != 0) && (ic != EOF) - && (ic != AFTER_COMMENT_MARKER[0])) + && (ic != (int) AFTER_COMMENT_MARKER[0])) { c = (char) ic; @@ -2004,7 +2078,7 @@ static int handleLlSpecial () DPRINTF (("Read: %s / %s", s, fileloc_unparse (g_currentloc))); - if (ic == AFTER_COMMENT_MARKER[0]) + if (ic == (int) AFTER_COMMENT_MARKER[0]) { int nc = ninput (); llassert ((char) nc == AFTER_COMMENT_MARKER[1]); @@ -2124,7 +2198,10 @@ static int handleLlSpecial () rest++; s++; } - + s--; /* evans 2002-07-12: this was previously only in the else branch. + Leads to an invalid read on the true branch. + */ + sfree (orest); if (cstring_isUndefined (extra)) @@ -2134,11 +2211,10 @@ static int handleLlSpecial () message ("Flag %s (in semantic comment) must be followed by an argument", flagcode_unparse (fflag))); + } else { - s--; - if (flagcode_hasNumber (fflag)) { setValueFlag (fflag, extra); @@ -2153,6 +2229,7 @@ static int handleLlSpecial () } else { + cstring_free (extra); BADEXIT; } } @@ -2206,7 +2283,7 @@ static int handleLlSpecial () if (macrocode != BADTOK) { - tokLength = hasnl ? 0 : mstring_length (t); + tokLength = hasnl ? 0 : size_toInt (mstring_length (t)); sfree (t); sfree (os); @@ -2295,7 +2372,7 @@ static int handleLlSpecial () while (lc >= '0' && lc <= '9') { val *= 10; - val += lc - '0'; + val += (int) (lc - '0'); lc = *(++tt); } } @@ -2324,7 +2401,7 @@ static int handleLlSpecial () while (TRUE) { - while ((c = *s) && (c == ' ' || c == '\t' || c == '\n')) + while (((c = *s) != '\0') && (c == ' ' || c == '\t' || c == '\n')) { s++; } @@ -2402,7 +2479,7 @@ static int handleLlSpecial () while (TRUE) { - while ((lc = *s) && (lc == ' ' || lc == '\t' || lc == '\n')) + while (((lc = *s) != '\0') && (lc == ' ' || lc == '\t' || lc == '\n')) { s++; } @@ -2506,7 +2583,7 @@ static int handleLlSpecial () static /*@only@*/ cstring makeIdentifier (char *s) { - char *c = mstring_create (size_toInt (strlen (s)) + 1); + char *c = mstring_create (strlen (s) + 1); cstring id = cstring_fromChars (c); while (isalnum (*s) || (*s == '_') || (*s == '$')) @@ -2559,9 +2636,26 @@ static /*@only@*/ cstring makeIdentifier (char *s) return (usymtab_lookup (cn)); } -/*@observer@*/ cstring LastIdentifier () +/* +** Need to keep this in case there is a declaration that isn't processed until +** the scope exits. Would be good to rearrange the symbol table so this doesn't +** happen, and save all the cstring copying. +*/ + +/*@observer@*/ cstring cscanner_observeLastIdentifier () { - return (lastidprocessed); + cstring res = s_lastidprocessed; + return res; +} + +static void cscanner_setLastIdentifier (/*@keep@*/ cstring id) /*@modifies s_lastidprocessed@*/ +{ + if (cstring_isDefined (s_lastidprocessed)) + { + cstring_free (s_lastidprocessed); + } + + s_lastidprocessed = id; } static int processIdentifier (cstring id) @@ -2574,7 +2668,7 @@ static int processIdentifier (cstring id) } context_clearJustPopped (); - lastidprocessed = id; + cscanner_setLastIdentifier (id); if (context_inFunctionHeader ()) { @@ -2694,22 +2788,23 @@ static int processIdentifier (cstring id) while ((ic = input ()) != EOF) { - + char cc = (char) ic; + if (inescape) { inescape = FALSE; } - else if (ic == '\\') + else if (cc == '\\') { inescape = TRUE; } - else if (ic == '\"') + else if (cc == '\"') { inquote = !inquote; } else if (!inquote) { - if (ic == '(') + if (cc == '(') { if (!useparens) { @@ -2724,7 +2819,7 @@ static int processIdentifier (cstring id) depth++; } } - else if (ic == '{') + else if (cc == '{') { if (!usebraces) { @@ -2739,17 +2834,17 @@ static int processIdentifier (cstring id) depth++; } } - else if (ic == ')' && useparens) + else if (cc == ')' && useparens) { depth--; if (depth == 0) break; } - else if (ic == '}' && usebraces) + else if (cc == '}' && usebraces) { depth--; if (depth == 0) break; } - else if (ic == '}' + else if (cc == '}' && !usebraces && !useparens && cstring_equalLit (id, "__asm")) { @@ -2761,9 +2856,17 @@ static int processIdentifier (cstring id) */ return TRBRACE; } + else + { + ; + } + } + else + { + ; } - if (ic == '\n') + if (cc == '\n') { context_incLineno (); @@ -2775,8 +2878,8 @@ static int processIdentifier (cstring id) } } - llassert ((useparens && ic == ')') - || (usebraces && ic == '}') + llassert ((useparens && ic == (int) ')') + || (usebraces && ic == (int) '}') || (!useparens && !usebraces)); return BADTOK; @@ -2788,6 +2891,10 @@ static int processIdentifier (cstring id) { tok = QINLINE; } + else + { + ; + } if (tok != BADTOK) { @@ -2811,7 +2918,7 @@ static int processIdentifier (cstring id) } else if (uentry_isUndefined (le)) { - yylval.cname = id; + yylval.cname = cstring_copy (id); /* avoid parse errors for certain system built ins */ @@ -2827,7 +2934,7 @@ static int processIdentifier (cstring id) { if (uentry_isDatatype (le)) { - yylval.cname = id; + yylval.cname = cstring_copy (id); return (NEW_IDENTIFIER); } else @@ -2840,7 +2947,7 @@ static int processIdentifier (cstring id) { if (!g_expectingTypeName) { - yylval.cname = id; + yylval.cname = cstring_copy (id); return (NEW_IDENTIFIER); } @@ -2870,8 +2977,8 @@ static bool processHashIdentifier (/*@only@*/ cstring id) context_clearJustPopped (); - lastidprocessed = id; le = usymtab_lookupSafe (id); + cscanner_setLastIdentifier (id); if (uentry_isParam (le) || uentry_isRefParam (le)) { @@ -2894,7 +3001,7 @@ static bool processHashIdentifier (/*@only@*/ cstring id) } -static /*@only@*/ exprNode processString () +static /*@only@*/ exprNode processString (void) { exprNode res; fileloc loc; @@ -2904,7 +3011,7 @@ static /*@only@*/ exprNode processString () if (nl == NULL) { loc = fileloc_copy (g_currentloc); - addColumn (cstring_length (ns)); + addColumn (size_toInt (cstring_length (ns))); } else { @@ -2945,7 +3052,7 @@ static /*@only@*/ exprNode processWideString () if (nl == NULL) { loc = fileloc_copy (g_currentloc); - addColumn (cstring_length (ns)); + addColumn (size_toInt (cstring_length (ns))); } else { diff --git a/src/cstring.c b/src/cstring.c index 0435198..d867531 100644 --- a/src/cstring.c +++ b/src/cstring.c @@ -727,7 +727,6 @@ cstring_concatFree1 (cstring s, cstring t) return res; } -# ifndef NOLCL /*@only@*/ cstring cstring_concatChars (cstring s, char *t) { @@ -735,7 +734,6 @@ cstring_concatChars (cstring s, char *t) cstring_free (s); return res; } -# endif /*@only@*/ cstring cstring_concatLength (cstring s1, char *s2, size_t len) /*@requires maxSet(s2) >= (len - 1) @*/ @@ -793,7 +791,6 @@ cstring_prependChar (char c, /*@temp@*/ cstring s1) return s; } -# ifndef NOLCL bool cstring_hasNonAlphaNumBar (cstring s) { @@ -813,7 +810,6 @@ cstring_hasNonAlphaNumBar (cstring s) } return FALSE; } -# endif /*@only@*/ /*@notnull@*/ cstring cstring_create (size_t n) @@ -836,7 +832,6 @@ cstring_copySegment (cstring s, size_t findex, size_t tindex) return res; } -# ifndef NOLCL lsymbol cstring_toSymbol (cstring s) { lsymbol res = lsymbol_fromString (s); @@ -844,7 +839,6 @@ lsymbol cstring_toSymbol (cstring s) cstring_free (s); return res; } -# endif cstring cstring_bsearch (cstring key, char **table, int nentries) { diff --git a/src/cstringList.c b/src/cstringList.c index 479b4be..bdd2e57 100644 --- a/src/cstringList.c +++ b/src/cstringList.c @@ -266,8 +266,17 @@ cstringList_free (cstringList s) { if (cstringList_isDefined (s)) { + int i; + DPRINTF (("cstringList free: [%p] %s", s, cstringList_unparse (s))); + + /* evans 2002-07-12: this was missing, not detected because of reldef */ + for (i = 0; i < s->nelements; i++) + { + cstring_free (s->elements[i]); + } + sfree (s->elements); sfree (s); } diff --git a/src/cstringTable.c b/src/cstringTable.c index 6f2ba81..4246e22 100644 --- a/src/cstringTable.c +++ b/src/cstringTable.c @@ -49,7 +49,7 @@ static /*@nullwhentrue@*/ bool hbucket_isNull (/*@null@*/ hbucket h) return (h == hbucket_undefined); } -static hentry hentry_create (/*@keep@*/ cstring key, int val) +static hentry hentry_create (/*@only@*/ cstring key, int val) { hentry h = (hentry) dmalloc (sizeof (*h)); @@ -148,7 +148,7 @@ hbucket_add (/*@notnull@*/ hbucket h, /*@only@*/ hentry e) } llassert (e->val != HBUCKET_DNE); - /*drl bee: si*/ h->entries[h->size] = e; + /*drl bee: si*/ h->entries[h->size] = e; h->size++; h->nspace--; } @@ -186,7 +186,14 @@ void hbucket_free (/*@only@*/ hbucket h) { if (!hbucket_isNull (h)) { - /*@i32@*/ sfree (h->entries); + int i; + /* evans 2002-07-12: added this to free entries (splint warning had been suppressed) */ + for (i = 0; i < h->size; i++) + { + hentry_free (h->entries[i]); + } + + sfree (h->entries); sfree (h); } } @@ -200,7 +207,7 @@ cstringTable_free (/*@only@*/ cstringTable h) for (i = 0; i < h->size; i++) { - /*drl bee: si*/ hbucket_free (h->buckets[i]); + /*drl bee: si*/ hbucket_free (h->buckets[i]); } sfree (h->buckets); @@ -256,7 +263,7 @@ cstringTable_hashValue (/*@notnull@*/ cstringTable h, cstring key) for (p = cstring_toCharsSafe (key); *p != '\0'; p++) { - /*drl bee: nm*/ hash_value = (hash_value << 1) ^ g_randomNumbers[*p % 256]; + /*drl bee: nm*/ hash_value = (hash_value << 1) ^ g_randomNumbers[*p % 256]; } return (hash_value % h->size); @@ -430,8 +437,8 @@ cstringTable_insert (cstringTable h, cstring key, int value) cstringTable_rehash (h); } - e = hentry_create (key, value); hindex = cstringTable_hashValue (h, key); + e = hentry_create (key, value); /*drl bee: si*/ hb = h->buckets[hindex]; @@ -473,7 +480,7 @@ cstringTable_update (cstringTable h, cstring key, int newval) { /*drl bee: si*/ if (cstring_equal (hb->entries[i]->key, key)) { - /*drl bee: si*/ hb->entries[i]->val = newval; + /*drl bee: si*/ hb->entries[i]->val = newval; return; } } @@ -491,7 +498,7 @@ cstringTable_replaceKey (cstringTable h, cstring oldkey, /*@only@*/ cstring newk { hbucket hb; llassert (cstringTable_isDefined (h)); - + hb = cstringTable_hash (h, oldkey); llassert (cstring_equal (oldkey, newkey)); @@ -503,7 +510,7 @@ cstringTable_replaceKey (cstringTable h, cstring oldkey, /*@only@*/ cstring newk { /*drl bee: si*/ if (cstring_equal (hb->entries[i]->key, oldkey)) { - /*drl bee: si*/ hb->entries[i]->key = newkey; + /*drl bee: si*/ hb->entries[i]->key = newkey; return; } } @@ -531,7 +538,7 @@ cstringTable_remove (cstringTable h, cstring key) if (i < hb->size - 1) { /*drl bee: si*/ - /*drl bee: si*/ hb->entries[i] = hb->entries[hb->size - 1]; + hb->entries[i] = hb->entries[hb->size - 1]; } hb->size--; diff --git a/src/cttable.i b/src/cttable.i index c75982a..c50c8d6 100644 --- a/src/cttable.i +++ b/src/cttable.i @@ -360,6 +360,7 @@ static void cttable_load (FILE *f) /*@modifies cttab, f @*/ { char *s = mstring_create (MAX_DUMP_LINE_LENGTH); + char *os = s; ctentry cte; cttable_reset (); @@ -383,7 +384,7 @@ static void cttable_load (FILE *f) { ctype ct; - /*drl bee: tcf*/ cte = ctentry_undump (s); + /*drl bee: tcf*/ cte = ctentry_undump (s); ct = cttable_addFull (cte); DPRINTF (("Type: %d: %s", ct, ctype_unparse (ct))); @@ -394,10 +395,10 @@ static void cttable_load (FILE *f) ctype_recordConj (ct); } - (void) reader_readLine (f, s, MAX_DUMP_LINE_LENGTH); + s = reader_readLine (f, s, MAX_DUMP_LINE_LENGTH); } - sfree (s); + sfree (os); /* DPRINTF (("Done loading cttable: ")); diff --git a/src/exprNode.c b/src/exprNode.c index 8940676..648c062 100644 --- a/src/exprNode.c +++ b/src/exprNode.c @@ -29,6 +29,7 @@ # include "splintMacros.nf" # include "basic.h" # include "cgrammar.h" +# include "cscanner.h" # include "cgrammar_tokens.h" # include "exprChecks.h" @@ -218,13 +219,14 @@ exprNode_destroyMod (void) { if (initMod) { - uentry_free (regArg); - uentry_free (outArg); - uentry_free (outStringArg); + /* evans 2002-07-12: changed uentry_free to uentry_freeComplete */ + uentry_freeComplete (regArg); + uentry_freeComplete (outArg); + uentry_freeComplete (outStringArg); exprNode_free (s_mustExitNode); initMod = FALSE; - /*@-branchstate@*/ + /*@-branchstate@*/ } /*@=branchstate@*/ } @@ -1033,7 +1035,7 @@ exprNode_fromIdentifier (/*@observer@*/ uentry c) if (context_justPopped ()) /* watch out! c could be dead */ { - uentry ce = usymtab_lookupSafe (LastIdentifier ()); + uentry ce = usymtab_lookupSafe (cscanner_observeLastIdentifier ()); if (uentry_isValid (ce)) { @@ -3777,7 +3779,7 @@ functionCallSafe (/*@only@*/ /*@notnull@*/ exprNode f, /* f->typ is already set to the return type */ DPRINTF (("Function: %s", uentry_unparseFull (le))); - ret->sref = uentry_returnedRef (le, args); + ret->sref = uentry_returnedRef (le, args, exprNode_loc (f)); DPRINTF (("Returned: %s / %s", uentry_unparseFull (le), sRef_unparseFull (ret->sref))); @@ -3895,6 +3897,7 @@ functionCallSafe (/*@only@*/ /*@notnull@*/ exprNode f, reflectEnsuresClause (ret, le, f, args); setCodePoint (); + DPRINTF (("Here: %s", sRef_unparseFull (ret->sref))); return (ret); } @@ -4989,11 +4992,14 @@ exprNode_cast (/*@only@*/ lltok tok, /*@only@*/ exprNode e, /*@only@*/ qtype q) ret->sref = sRef_copy (e->sref); + DPRINTF (("Cast 2: -> %s", sRef_unparseFull (ret->sref))); + if (!sRef_isConst (e->sref)) { usymtab_addForceMustAlias (ret->sref, e->sref); } + DPRINTF (("Cast 2: -> %s", sRef_unparseFull (ret->sref))); sRef_setTypeFull (ret->sref, c); DPRINTF (("Cast 2: -> %s", sRef_unparseFull (ret->sref))); @@ -5007,7 +5013,18 @@ exprNode_cast (/*@only@*/ lltok tok, /*@only@*/ exprNode e, /*@only@*/ qtype q) if (ctype_isVoid (c)) /* cast to void is always okay --- discard value */ { - ; + /* evans 2002-07-19: added this warning */ + DPRINTF (("Checking: %s / %s", exprNode_unparse (ret), sRef_unparseFull (ret->sref))); + if (sRef_isFresh (ret->sref)) + { + voptgenerror + (FLG_MUSTFREEFRESH, + message ("New fresh storage %q(type %s) cast to void (not released): %s", + sRef_unparseOpt (ret->sref), + ctype_unparse (exprNode_getType (ret)), + exprNode_unparse (ret)), + exprNode_loc (ret)); + } } else if (ctype_isRealAP (c)) /* casting to array or pointer */ { diff --git a/src/exprNodeList.c b/src/exprNodeList.c index 5439246..e66082e 100644 --- a/src/exprNodeList.c +++ b/src/exprNodeList.c @@ -43,7 +43,7 @@ exprNodeList_new () dmalloc (sizeof (*s->elements) * exprNodeListBASESIZE); s->current = 0; - return (s); + return (s); } static void diff --git a/src/fileLib.c b/src/fileLib.c index dfda85e..b2b04f0 100644 --- a/src/fileLib.c +++ b/src/fileLib.c @@ -73,7 +73,6 @@ fileLib_isLCLFile (cstring s) /*@noaccess cstring@*/ } -# ifndef NOLCL /*@only@*/ cstring fileLib_removePath (cstring s) { /*@access cstring@*/ @@ -89,7 +88,6 @@ fileLib_isLCLFile (cstring s) else return (mstring_copy (t + 1)); /*@noaccess cstring@*/ } -# endif /*@only@*/ cstring fileLib_removePathFree (/*@only@*/ cstring s) @@ -225,7 +223,5 @@ cstring fileLib_cleanName (cstring s) return cstring_copySegment (s, 2, cstring_length (s) - 1); } - - return cstring_copy (s); } diff --git a/src/fileTable.c b/src/fileTable.c index dd04efc..7c2f606 100644 --- a/src/fileTable.c +++ b/src/fileTable.c @@ -192,7 +192,6 @@ ftentry_create (/*@keep@*/ cstring tn, bool temp, fileType typ, fileId der) } t->fname = tn; - t->basename = cstring_undefined; t->ftemp = temp; t->ftype = typ; @@ -226,7 +225,7 @@ fileTable_create () ft->nopen = 0; ft->nopenspace = FTBASESIZE; ft->openelements = (foentry *) dmalloc (FTBASESIZE * sizeof (*ft->openelements)); - + return (ft); } @@ -288,13 +287,17 @@ fileTable_internAddEntry (fileTable ft, /*@only@*/ ftentry e) { cstring sd = cstring_downcase (e->fname); cstringTable_insert (ft->htable, sd, ft->nentries); - cstring_free (e->fname); } else { - cstringTable_insert (ft->htable, e->fname, ft->nentries); + cstringTable_insert (ft->htable, cstring_copy (e->fname), ft->nentries); } + /* evans 2002-07-12: + Before, there was no cstring_copy above, and e->fname was free'd in the if branch. + Splint should have caught this, and produced a warning for this assignment. + Why not? + */ ft->elements[ft->nentries] = e; ft->nentries++; @@ -485,7 +488,6 @@ fileTable_addXHFile (fileTable ft, cstring name) return (fileTable_addFilePrim (ft, name, FALSE, FILE_XH, fileId_invalid)); } -# ifndef NOLCL fileId fileTable_addImportFile (fileTable ft, cstring name) { @@ -497,11 +499,8 @@ fileTable_addLCLFile (fileTable ft, cstring name) { return (fileTable_addFilePrim (ft, name, FALSE, FILE_HEADER, fileId_invalid)); } -# endif -# ifndef NOLCL static int tmpcounter = 0; -# endif fileId fileTable_addMacrosFile (fileTable ft) @@ -563,7 +562,6 @@ fileTable_addCTempFile (fileTable ft, fileId fid) return res; } -# ifndef NOLCL fileId fileTable_addltemp (fileTable ft) { @@ -610,7 +608,6 @@ fileTable_addltemp (fileTable ft) cstring_free (newname); return (ret); } -# endif bool fileTable_exists (fileTable ft, cstring s) @@ -879,6 +876,7 @@ fileTable_free (/*@only@*/ fileTable f) cstringTable_free (f->htable); sfree (f->elements); + sfree (f->openelements); /*!! why didn't splint report this? */ sfree (f); } diff --git a/src/fileloc.c b/src/fileloc.c index 151d7dd..23e4e7f 100644 --- a/src/fileloc.c +++ b/src/fileloc.c @@ -38,7 +38,29 @@ # include "osd.h" # include "portab.h" -static /*@only@*/ fileloc fileloc_createPrim (flkind p_kind, fileId p_fid, int p_line, int p_col); +static /*@only@*/ fileloc fileloc_createPrim (flkind p_kind, fileId p_fid, int p_line, int p_col) /*@*/ ; + +/* +** builtin locs are never free'd +*/ + +static /*@owned@*/ fileloc s_builtinLoc = fileloc_undefined; +static /*@owned@*/ fileloc s_externalLoc = fileloc_undefined; + +void fileloc_destroyMod () +{ + if (fileloc_isDefined (s_builtinLoc)) + { + sfree (s_builtinLoc); + s_builtinLoc = fileloc_undefined; + } + + if (fileloc_isDefined (s_externalLoc)) + { + sfree (s_externalLoc); + s_externalLoc = fileloc_undefined; + } +} static flkind fileId_kind (fileId s) { @@ -291,7 +313,6 @@ fileloc_notAfter (fileloc f1, fileloc f2) /*@noaccess fileId@*/ } -# ifndef NOLCL bool fileloc_isStandardLibrary (fileloc f) { @@ -304,7 +325,6 @@ fileloc_isStandardLibrary (fileloc f) || cstring_equalLit (s, LLPOSIXSTRICTLIBS_NAME) || cstring_equalLit (s, LLPOSIXLIBS_NAME)); } -# endif bool fileloc_sameFileAndLine (fileloc f1, fileloc f2) @@ -430,7 +450,6 @@ fileloc_almostSameFile (fileloc f1, fileloc f2) } } -# ifndef NOLCL /*@only@*/ fileloc fileloc_fromTok (ltoken t) { @@ -447,7 +466,6 @@ fileloc_fromTok (ltoken t) return (fl); } -# endif /*@only@*/ fileloc fileloc_createLib (cstring ln) @@ -482,14 +500,12 @@ fileloc fileloc_createExternal (void) fileloc fileloc_getExternal (void) { - static /*@owned@*/ fileloc res = fileloc_undefined; - - if (res == fileloc_undefined) + if (s_externalLoc == fileloc_undefined) { - res = fileloc_createPrim (FL_EXTERNAL, fileId_invalid, 0, 0); + s_externalLoc = fileloc_createPrim (FL_EXTERNAL, fileId_invalid, 0, 0); } - return res; + return s_externalLoc; } fileloc fileloc_observeBuiltin () @@ -541,13 +557,20 @@ fileloc_makePreprocPrevious (fileloc loc) return (fileloc_createPrim (FL_PREPROC, fileId_invalid, 0, 0)); } +/* We pretend the result is only, because fileloc_free doesn't free it! */ /*@only@*/ fileloc fileloc_createBuiltin () { - return (fileloc_createPrim (FL_BUILTIN, fileId_invalid, 0, 0)); + if (fileloc_isUndefined (s_builtinLoc)) + { + s_builtinLoc = fileloc_createPrim (FL_BUILTIN, fileId_invalid, 0, 0); + } + + /*@-globstate@*/ /*@-retalias@*/ + return s_builtinLoc; + /*@=globstate@*/ /*@=retalias@*/ } -# ifndef NOLCL /*@only@*/ fileloc fileloc_createImport (cstring fname, int lineno) { @@ -560,7 +583,6 @@ fileloc_createImport (cstring fname, int lineno) return (fileloc_createPrim (FL_IMPORT, fid, lineno, 0)); } -# endif static /*@only@*/ fileloc fileloc_createPrim (flkind kind, fileId fid, int line, int col) @@ -576,13 +598,11 @@ fileloc_createPrim (flkind kind, fileId fid, int line, int col) return (f); } -# ifndef NOLCL /*@only@*/ fileloc fileloc_createSpec (fileId fid, int line, int col) { return (fileloc_createPrim (FL_SPEC, fid, line, col)); } -# endif fileloc fileloc_create (fileId fid, int line, int col) { diff --git a/src/flags.c b/src/flags.c index 9f97ef1..0a8cea3 100644 --- a/src/flags.c +++ b/src/flags.c @@ -1642,7 +1642,7 @@ flags_processFlags (bool inCommandLine, fileIdList cfiles, fileIdList lclfiles, fileIdList mtfiles, - cstringSList *passThroughArgs, + cstringList *passThroughArgs, int argc, char **argv) { int i; @@ -1696,8 +1696,8 @@ flags_processFlags (bool inCommandLine, ** Following space is optional, don't include the - */ - *passThroughArgs = cstringSList_add (*passThroughArgs, - cstring_fromChars (thisarg + 1)); + *passThroughArgs = cstringList_add (*passThroughArgs, + cstring_fromCharsNew (thisarg + 1)); } else if (opt == FLG_INCLUDEPATH || opt == FLG_SPECPATH) { @@ -1799,12 +1799,10 @@ flags_processFlags (bool inCommandLine, } else if (opt == FLG_INIT) { -# ifndef NOLCL lslinit_setInitFile (inputStream_create (arg, cstring_makeLiteralTemp (LCLINIT_SUFFIX), FALSE)); -# endif break; } else @@ -1922,4 +1920,6 @@ flags_processFlags (bool inCommandLine, g_currentloc); } } + + cstringSList_free (fl); /* evans 2002-07-12: why wasn't this reported!?? */ } diff --git a/src/flags.def b/src/flags.def index f78ed3b..7ecb38d 100644 --- a/src/flags.def +++ b/src/flags.def @@ -1294,7 +1294,7 @@ static flaglist flags = "warnmissingglobs", FLG_WARNMISSINGGLOBALS, "global variable used in modifies clause is not listed in globals list", - "A global variable is used in the modifies clause, but it not listed in " + "A global variable is used in the modifies clause, but it is not listed in " "the globals list. The variable will be added to the globals list.", 0, 0 }, @@ -3810,7 +3810,7 @@ static flaglist flags = FK_TYPEEQ, FK_POINTER, plainFlag, "zeroptr", FLG_ZEROPTR, - "tread 0 as a pointer", + "treat 0 as a pointer", NULL, 0, 0 }, { diff --git a/src/flex.head b/src/flex.head index c73de11..ba7ff4c 100644 --- a/src/flex.head +++ b/src/flex.head @@ -52,6 +52,7 @@ /*@-protoparammatch@*/ /*@-casebreak@*/ /*@-retvalother@*/ +/*@-exportheader@*/ /*drl added 11/27/2001*/ diff --git a/src/general.c b/src/general.c index 5a2e090..b4bbca9 100644 --- a/src/general.c +++ b/src/general.c @@ -187,7 +187,6 @@ void *direalloc (/*@out@*/ /*@null@*/ void *x, size_t size, /*@=mustdefine@*/ -# ifndef NOLCL char *FormatInt (int i) { char temp[255]; /* assume the integer has at most 254 digits */ @@ -199,9 +198,7 @@ char *FormatInt (int i) return (outs); } -# endif -# ifndef NOLCL bool firstWord (char *s, char *w) { llassert (s != NULL); @@ -214,7 +211,6 @@ bool firstWord (char *s, char *w) } return TRUE; } -# endif void mstring_markFree (char *s) { diff --git a/src/globals.c b/src/globals.c index 515592d..38504c3 100644 --- a/src/globals.c +++ b/src/globals.c @@ -30,10 +30,8 @@ fileloc g_currentloc; -# ifndef NOLCL symtable g_symtab; /*@only@*/ lsymbolSet g_currentImports = lsymbolSet_undefined; -# endif cstring g_codeFile = cstring_undefined; int g_codeLine = 0; @@ -55,10 +53,8 @@ FILE *g_errorstream = NULL; /*@observer@*/ char *g_localSpecPath = "."; -# ifndef NOLCL /*@only@*/ cstring g_currentSpec; /*@only@*/ char *g_currentSpecName; -# endif void printCodePoint (void) { diff --git a/src/inputStream.c b/src/inputStream.c index 743b264..c77990b 100644 --- a/src/inputStream.c +++ b/src/inputStream.c @@ -76,11 +76,12 @@ inputStream_free (/*@null@*/ /*@only@*/ inputStream s) } extern /*@only@*/ inputStream - inputStream_create (cstring name, cstring suffix, bool echo) +inputStream_create (cstring name, cstring suffix, bool echo) { char *ps; inputStream s = (inputStream) dmalloc (sizeof (*s)); - + cstring oname; + s->name = name; s->file = NULL; @@ -100,7 +101,9 @@ extern /*@only@*/ inputStream s->name = cstring_concatFree1 (s->name, suffix); } + oname = s->name; s->name = fileLib_cleanName (s->name); + cstring_free (oname); /* evans 2002-07-12: why no error without this?! */ s->lineNo = 0; s->charNo = 0; @@ -109,8 +112,9 @@ extern /*@only@*/ inputStream s->fromString = FALSE; s->stringSource = NULL; s->stringSourceTail = NULL; - - /*@i3254@*/ return s; + s->buffer[0] = '\0'; + + return s; } extern /*@only@*/ inputStream diff --git a/src/intSet.c b/src/intSet.c index 717db6c..6ea1d5c 100644 --- a/src/intSet.c +++ b/src/intSet.c @@ -131,7 +131,6 @@ intSet_member (intSet s, int el) return FALSE; } -# ifndef NOLCL /*@only@*/ cstring intSet_unparseText (intSet s) { @@ -151,7 +150,6 @@ intSet_unparseText (intSet s) return st; } -# endif /*@only@*/ cstring intSet_unparse (intSet s) diff --git a/src/lcllib.c b/src/lcllib.c index ac388a6..15a08c5 100644 --- a/src/lcllib.c +++ b/src/lcllib.c @@ -39,12 +39,10 @@ # include "splintMacros.nf" # include "llbasic.h" # include "osd.h" +# include "version.h" -# ifndef NOLCL # include "gram.h" - # include "lclscan.h" -# endif # include "lcllib.h" # include "llmain.h" diff --git a/src/lclscanline.c b/src/lclscanline.c index 0563f60..5bdf8f1 100644 --- a/src/lclscanline.c +++ b/src/lclscanline.c @@ -775,11 +775,11 @@ ScanCString (void) } else if (currentChar == '\n') { - LocalUserError ("unterminated C string"); + LocalUserError ("Unterminated C string"); } else { - LocalUserError ("invalid character in C string"); + LocalUserError ("Invalid character in C string"); } } LCLMOVECHAR (); /* discard closing quote */ @@ -822,11 +822,11 @@ ScanCChar (void) } else if (currentChar == '\n') { - LocalUserError ("unterminated C character constant"); + LocalUserError ("Unterminated C character constant"); } else { - LocalUserError ("invalid character in C character"); + LocalUserError ("Invalid character in C character"); } } LCLMOVECHAR (); /* discard closing quote */ @@ -834,7 +834,7 @@ ScanCChar (void) } else { - LocalUserError ("invalid C character"); + LocalUserError ("Invalid C character"); } diff --git a/src/llerror.c b/src/llerror.c index 023e99c..16ab431 100644 --- a/src/llerror.c +++ b/src/llerror.c @@ -42,10 +42,7 @@ static void printIndentMessage (FILE *p_stream, /*@only@*/ cstring p_sc, int p_indent) /*@modifies *p_stream@*/ ; -# ifndef NOLCL static int lclerrors = 0; -# endif - static size_t lastfileloclen = 10; static /*@only@*/ cstring lastmsg = cstring_undefined; static int mcount = 0; @@ -118,7 +115,7 @@ void closeMessage (void) && context_getFlag (FLG_SHOWSCAN)) { llflush (); - displayScanOpen (cstring_makeLiteral ("< more preprocessing .")); + displayScanOpen (cstring_makeLiteral ("more preprocessing .")); llassertprotect (!s_needsPrepare); s_needsPrepare = TRUE; } @@ -665,7 +662,20 @@ llgentypeerroraux (char *srcFile, int srcLine, { if (!bool_equal (ctype_isSigned (ut1), ctype_isSigned (ut2))) { - hcode = FLG_IGNORESIGNS; + if (ctype_isArbitraryIntegral (ctype_realType (ut1)) + && !ctype_isArbitraryIntegral (ctype_realType (ut2))) + { + hcode = FLG_MATCHANYINTEGRAL; + } + else if (ctype_isArbitraryIntegral (ctype_realType (ut2)) + && !ctype_isArbitraryIntegral (ctype_realType (ut1))) + { + hcode = FLG_MATCHANYINTEGRAL; + } + else + { + hcode = FLG_IGNORESIGNS; + } } else { @@ -837,8 +847,17 @@ llgentypeerroraux (char *srcFile, int srcLine, if (hcode != INVALID_FLAG && hcode != ocode) { code = hcode; - llshowhint (code); + if (context_flagOn (code, fl)) + { + /* The flag is alreay set, something buggy in the flag code */ + llcontbug (message ("No hint available, flag %s is already set.", + flagcode_unparse (code))); + } + else + { + llshowhint (code); + } } else { @@ -1331,7 +1350,6 @@ xllfatalbug (char *srcFile, int srcLine, /*@only@*/ cstring s) llexit (LLFAILURE); } -# ifndef NOLCL void lclfatalbug (char *msg) { @@ -1342,7 +1360,6 @@ lclfatalbug (char *msg) printBugReport (); llexit (LLFAILURE); } -# endif void checkParseError (void) @@ -1426,7 +1443,6 @@ void llbugaux (cstring file, int line, /*@only@*/ cstring s) inbug = FALSE; } -# ifndef NOLCL void lclbug (/*@only@*/ cstring s) { @@ -1437,7 +1453,6 @@ lclbug (/*@only@*/ cstring s) fprintf (g_errorstream, " (attempting to continue, results may be incorrect)\n"); closeMessage (); } -# endif void xllfatalerror (char *srcFile, int srcLine, cstring s) @@ -1461,7 +1476,6 @@ xllfatalerrorLoc (char *srcFile, int srcLine, /*@only@*/ cstring s) llexit (LLFAILURE); } -# ifndef NOLCL bool lclHadError (void) { @@ -1563,7 +1577,6 @@ lclRedeclarationError (ltoken id) lclerror (id, message ("Identifier redeclared: %s", s)); } } -# endif void genppllerror (flagcode code, /*@only@*/ cstring s) { diff --git a/src/llmain.c b/src/llmain.c index 5d4c546..8b177b1 100644 --- a/src/llmain.c +++ b/src/llmain.c @@ -53,7 +53,6 @@ # include "osd.h" # include "help.h" -# ifndef NOLCL # include "gram.h" # include "lclscan.h" # include "scanline.h" @@ -68,7 +67,6 @@ # include "lclinit.h" # include "lh.h" # include "imports.h" -# endif # include "Headers/version.h" /* Visual C++ finds the wrong version.h */ # include "lcllib.h" @@ -100,8 +98,6 @@ static fileIdList preprocessFiles (fileIdList, bool) static void warnSysFiles(fileIdList p_files) /*@modifies fileSystem@*/; -# ifndef NOLCL - static void lslCleanup (void) /*@globals killed g_symtab@*/ @@ -257,7 +253,6 @@ lslProcess (fileIdList lclfiles) g_currentSpec = cstring_undefined; g_currentSpecName = NULL; } -# endif static void handlePassThroughFlag (char *arg) { @@ -372,15 +367,6 @@ void showHerald (void) # endif int main (int argc, char *argv[]) -# ifdef NOLCL - /*@globals killed undef g_currentloc, - killed undef yyin, - undef g_warningstream, g_messagestream, g_errorstream; - @*/ - /*@modifies g_currentloc, fileSystem, - yyin; - @*/ -# else /*@globals killed undef g_currentloc, killed g_localSpecPath, killed undef g_currentSpec, @@ -391,14 +377,13 @@ int main (int argc, char *argv[]) /*@modifies g_currentloc, g_localSpecPath, g_currentSpec, g_currentSpecName, fileSystem, yyin; @*/ -# endif { bool first_time = TRUE; bool expsuccess; inputStream sourceFile = inputStream_undefined; fileIdList dercfiles; - cstringSList passThroughArgs = cstringSList_undefined; + cstringList passThroughArgs = cstringList_undefined; fileIdList cfiles, xfiles, lclfiles, mtfiles; clock_t before, lcltime, libtime, pptime, cptime, rstime; int i = 0; @@ -415,10 +400,11 @@ int main (int argc, char *argv[]) (void) signal (SIGSEGV, llinterrupt); flags_initMod (); + qual_initMod (); clabstract_initMod (); typeIdSet_initMod (); - cppReader_initMod (); osd_initMod (); + cppReader_initMod (); setCodePoint (); @@ -745,11 +731,7 @@ int main (int argc, char *argv[]) if (anylcl) { -# ifdef NOLCL - llfatalerror (cstring_makeLiteral ("This version of Splint does not handle LCL files.")); -# else lslProcess (lclfiles); -# endif } usymtab_initGlobalMarker (); @@ -766,13 +748,13 @@ int main (int argc, char *argv[]) DPRINTF (("Pass through: %s", cstringSList_unparse (passThroughArgs))); - cstringSList_elements (passThroughArgs, thisarg) + cstringList_elements (passThroughArgs, thisarg) { handlePassThroughFlag (cstring_toCharsSafe (thisarg)); } - end_cstringSList_elements; + end_cstringList_elements; - cstringSList_free (passThroughArgs); + cstringList_free (passThroughArgs); cleanupMessages (); @@ -878,8 +860,11 @@ int main (int argc, char *argv[]) (void) inputStream_close (sourceFile); } + + inputStream_free (sourceFile); /* evans 2002-07-12: why no warning without this?!! */ } end_fileIdList_elements; + fileIdList_free (dercfiles); /* evans 2002-07-12: why no warning without this?!! */ cptime = clock (); /* process any leftover macros */ @@ -953,16 +938,13 @@ int main (int argc, char *argv[]) { bool isQuiet = context_getFlag (FLG_QUIET); cstring specErrors = cstring_undefined; -# ifndef NOLCL int nspecErrors = lclNumberErrors (); -# endif expsuccess = TRUE; if (context_neednl ()) fprintf (g_warningstream, "\n"); -# ifndef NOLCL if (nspecErrors > 0) { if (nspecErrors == context_getLCLExpect ()) @@ -997,7 +979,6 @@ int main (int argc, char *argv[]) expsuccess = FALSE; } } -# endif if (context_anyErrors ()) { @@ -1097,17 +1078,29 @@ int main (int argc, char *argv[]) specmsg = message ("%d spec, ", specLines); } + /* The clock might wrap around, not platform-independent easy way to deal with this... */ + if (ttime > 0) + { # ifndef CLOCKS_PER_SEC - lldiagmsg (message ("%s%d source lines in %d time steps (steps/sec unknown)\n", - specmsg, - context_getLinesProcessed (), - (int) ttime)); + lldiagmsg (message ("%s%d source lines in %d time steps (steps/sec unknown)\n", + specmsg, + context_getLinesProcessed (), + (int) ttime)); # else - lldiagmsg (message ("%s%d source lines in %f s.\n", - specmsg, - context_getLinesProcessed (), - (double) ttime / CLOCKS_PER_SEC)); + lldiagmsg (message ("%s%d source lines in %f s.\n", + specmsg, + context_getLinesProcessed (), + (double) ttime / CLOCKS_PER_SEC)); + DPRINTF (("Time: %ld [%ld - %ld]", ttime, rstime, before)); # endif + } + else + { + lldiagmsg (message ("%s%d source lines\n", + specmsg, + context_getLinesProcessed ())); + } + } else { @@ -1259,13 +1252,16 @@ llexit (int status) if (status != LLFAILURE) { + usymtab_destroyMod (); context_destroyMod (); exprNode_destroyMod (); - + cppReader_destroyMod (); sRef_destroyMod (); uentry_destroyMod (); typeIdSet_destroyMod (); - + qual_destroyMod (); + osd_destroyMod (); + fileloc_destroyMod (); # ifdef USEDMALLOC dmalloc_shutdown (); # endif @@ -1331,12 +1327,11 @@ static fileIdList preprocessFiles (fileIdList fl, bool xhfiles) fileIdList_add (dfiles, dfile); } } end_fileIdList_elements; - - return dfiles; + + return dfiles; } /* This should be in an lclUtils.c file... */ -# ifndef NOLCL char *specFullName (char *specfile, /*@out@*/ char **inpath) { /* extract the path and the specname associated with the given file */ @@ -1405,7 +1400,6 @@ char *specFullName (char *specfile, /*@out@*/ char **inpath) return specname; } -# endif void warnSysFiles(fileIdList files) { diff --git a/src/lltok.c b/src/lltok.c index 4906dc5..941b596 100644 --- a/src/lltok.c +++ b/src/lltok.c @@ -271,3 +271,16 @@ void lltok_free (lltok t) sfree (t); } +void lltok_free2 (lltok t1, lltok t2) +{ + lltok_free (t1); + lltok_free (t2); +} + +void lltok_free3 (lltok t1, lltok t2, lltok t3) +{ + lltok_free (t1); + lltok_free (t2); + lltok_free (t3); +} + diff --git a/src/nameChecks.c b/src/nameChecks.c index cce86e6..d17a941 100644 --- a/src/nameChecks.c +++ b/src/nameChecks.c @@ -1542,7 +1542,4 @@ void checkParamNames (uentry ue) } } - - - /*@i523 POSIX p. 527 - applications should not declare any symbols that end _MAX @*/ diff --git a/src/osd.c b/src/osd.c index a78861f..938db13 100644 --- a/src/osd.c +++ b/src/osd.c @@ -453,8 +453,6 @@ nextdir (d_char *current_dir, d_char *dir, size_t *len) # endif } -# ifndef NOLCL - # ifdef WIN32 extern /*@external@*/ int _flushall (void) /*@modifies fileSystem@*/ ; # endif @@ -473,7 +471,6 @@ int osd_system (cstring cmd) res = system (cstring_toCharsSafe (cmd)); return res; } -# endif # ifndef unlink /* This should be defined by unistd.h */ @@ -888,6 +885,12 @@ void osd_initMod (void) osd_setWorkingDirectory (); } +void osd_destroyMod (void) +{ + cstring_free (osd_cwd); + osd_cwd = cstring_undefined; +} + cstring osd_absolutePath (cstring cwd, cstring filename) { # if defined (UNIX) || defined (OS2) @@ -1046,7 +1049,8 @@ cstring osd_outputPath (cstring filename) /*@access cstring@*/ path_p = filename; - rel_buf_p = rel_buffer = (char *) dmalloc (filename_len); + rel_buffer = (char *) dmalloc (filename_len); + rel_buf_p = rel_buffer; *rel_buf_p = '\0'; llassert (cwd_p != NULL); @@ -1061,10 +1065,14 @@ cstring osd_outputPath (cstring filename) if ((*cwd_p == '\0') && (*path_p == '\0' || osd_isConnectChar (*path_p))) /* whole pwd matched */ { if (*path_p == '\0') /* input *is* the current path! */ - return cstring_makeLiteral ("."); + { + cstring_free (rel_buffer); + return cstring_makeLiteral ("."); + } else { /*@i324 ! splint didn't report an errors for: return ++path_p; */ + cstring_free (rel_buffer); return cstring_fromCharsNew (path_p + 1); } } @@ -1079,7 +1087,8 @@ cstring osd_outputPath (cstring filename) { --cwd_p; --path_p; - while (!osd_isConnectChar (*cwd_p)) /* backup to last slash */ + + while (cwd_p >= osd_cwd && !osd_isConnectChar (*cwd_p)) /* backup to last slash */ { --cwd_p; --path_p; @@ -1100,6 +1109,8 @@ cstring osd_outputPath (cstring filename) Reject it if longer than the input. */ if (unmatched_slash_count * 3 + strlen (path_p) >= filename_len) { + cstring_free (rel_buffer); + /* fprintf (stderr, "Returning filename: %s [%p]\n", filename); */ return cstring_copy (filename); } # endif @@ -1121,6 +1132,7 @@ cstring osd_outputPath (cstring filename) } /* Then tack on the unmatched part of the desired file's name. */ + do { if (rel_buffer + filename_len <= rel_buf_p) @@ -1138,6 +1150,7 @@ cstring osd_outputPath (cstring filename) if (osd_isConnectChar (*(rel_buf_p-1))) *--rel_buf_p = '\0'; + /* fprintf (stderr, "Returning buffer: %s [%p]\n", rel_buffer, rel_buffer); */ return rel_buffer; } /*@noaccess cstring@*/ diff --git a/src/qtype.c b/src/qtype.c index 19df773..9762a1e 100644 --- a/src/qtype.c +++ b/src/qtype.c @@ -67,7 +67,6 @@ qtype qtype_addQual (qtype qt, qual q) return qt; } -# ifndef NOLCL qtype qtype_addQualList (/*@returned@*/ qtype qt, qualList ql) { if (qtype_isDefined (qt)) @@ -77,7 +76,6 @@ qtype qtype_addQualList (/*@returned@*/ qtype qt, qualList ql) return qt; } -# endif static void checkAltQuals (qtype q) { @@ -105,7 +103,6 @@ static void checkAltQuals (qtype q) } } -# ifndef NOLCL qtype qtype_mergeImplicitAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2) { if (qtype_isDefined (q1) && qtype_isDefined (q2)) @@ -121,7 +118,6 @@ qtype qtype_mergeImplicitAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2) qtype_free (q2); return q1; } -# endif qtype qtype_mergeAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2) { @@ -221,7 +217,6 @@ void qtype_adjustPointers (pointers n, qtype q) pointers_free (n); } -# ifndef NOLCL qtype qtype_copy (qtype q) { if (qtype_isDefined (q)) @@ -237,4 +232,3 @@ qtype qtype_copy (qtype q) return qtype_undefined; } } -# endif diff --git a/src/qual.c b/src/qual.c index 08af30e..959cb79 100644 --- a/src/qual.c +++ b/src/qual.c @@ -30,7 +30,7 @@ # include "splintMacros.nf" # include "basic.h" -static qual qual_createPlainAux (int i) +static qual qual_createPlainAux (int i) /*@*/ { qual res = (qual) dmalloc (sizeof (*res)); res->kind = (quenum) i; @@ -40,22 +40,47 @@ static qual qual_createPlainAux (int i) return res; } -extern qual qual_createPlain (quenum q) +static qual qtable[QU_LAST]; +static bool isinit = FALSE; + +extern void qual_initMod (void) { - static bool isinit = FALSE; - static qual qtable[QU_LAST]; + int i = (int) QU_UNKNOWN; + llassert (!isinit); + + while (i < (int) QU_LAST) { + qtable[i] = qual_createPlainAux (i); + i++; + } + + isinit = TRUE; +} - if (!isinit) { - int i = (int) QU_UNKNOWN; +static void qual_free (qual p_q) ; - while (i < (int) QU_LAST) { - qtable[i] = qual_createPlainAux (i); - i++; +extern void qual_destroyMod (void) +{ + if (isinit) + { + int i = (int) QU_UNKNOWN; + isinit = FALSE; + + while (i < (int) QU_LAST) { + qual_free (qtable[i]); + i++; + } } +} - isinit = TRUE; - } +static void qual_free (qual q) +{ + llassert (!isinit); + sfree (q); +} +extern qual qual_createPlain (quenum q) +{ + llassert (isinit); llassert (q != QU_USERANNOT && q < QU_LAST); return qtable[(int) q]; } @@ -186,18 +211,10 @@ extern annotationInfo qual_getAnnotationInfo (qual q) return q->info; } -/* Cannot call qual_create after this... */ - -# if 0 -static void qual_free (qual q) -{ - llassert (FALSE); - sfree (q); -} -# endif - extern cstring qual_dump (qual q) { + llassert (isinit); + if (q->kind == QU_USERANNOT) { return message ("%d.%s", @@ -214,6 +231,7 @@ extern cstring qual_dump (qual q) extern qual qual_undump (char **s) { quenum q = (quenum) reader_getInt (s); + llassert (isinit); if (q == QU_USERANNOT) { diff --git a/src/qualList.c b/src/qualList.c index 39182b6..3711bcb 100644 --- a/src/qualList.c +++ b/src/qualList.c @@ -108,7 +108,6 @@ qualList qualList_appendList (qualList s, qualList t) return s; } -# ifndef NOLCL qualList qualList_copy (qualList s) { qualList t = qualList_new (); @@ -120,7 +119,6 @@ qualList qualList_copy (qualList s) return t; } -# endif /*@only@*/ cstring qualList_unparse (qualList s) @@ -144,7 +142,6 @@ qualList_unparse (qualList s) return st; } -# ifndef NOLCL /*@only@*/ cstring qualList_toCComments (qualList s) { @@ -166,7 +163,6 @@ qualList_toCComments (qualList s) return st; } -# endif bool qualList_hasAliasQualifier (qualList s) diff --git a/src/rcfiles.c b/src/rcfiles.c index 0ff39cd..343afe8 100644 --- a/src/rcfiles.c +++ b/src/rcfiles.c @@ -30,11 +30,11 @@ # include "rcfiles.h" -static void rcfiles_loadFile (FILE *p_rcfile, cstringSList *p_passThroughArgs) +static void rcfiles_loadFile (FILE *p_rcfile, cstringList *p_passThroughArgs) /*@modifies *p_passThroughArgs, p_rcfile@*/ /*@ensures closed p_rcfile@*/ ; -bool rcfiles_read (cstring fname, cstringSList *passThroughArgs, bool report) +bool rcfiles_read (cstring fname, cstringList *passThroughArgs, bool report) { bool res = FALSE; @@ -80,7 +80,7 @@ bool rcfiles_read (cstring fname, cstringSList *passThroughArgs, bool report) return res; } -static void rcfiles_loadFile (/*:open:*/ FILE *rcfile, cstringSList *passThroughArgs) +static void rcfiles_loadFile (/*:open:*/ FILE *rcfile, cstringList *passThroughArgs) /*@modifies rcfile@*/ /*@ensures closed rcfile@*/ { @@ -173,7 +173,7 @@ static void rcfiles_loadFile (/*:open:*/ FILE *rcfile, cstringSList *passThrough } *s = c; - DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs))); + DPRINTF (("Pass through: %s", cstringList_unparse (*passThroughArgs))); while ((c == ' ') || (c == '\t')) { diff --git a/src/sRef.c b/src/sRef.c index 691b14f..9a32bb5 100644 --- a/src/sRef.c +++ b/src/sRef.c @@ -1070,6 +1070,7 @@ sRef_getUentry (sRef s) return sRef_getUentry (s->info->conj->b); } } + case SK_FIELD: /* evans 2002-07-17: added case for SK_FIELD */ case SK_UNKNOWN: case SK_SPECIAL: return uentry_undefined; @@ -3177,7 +3178,7 @@ sRef_unparseNoArgs (sRef s) s->kind = SK_UNCONSTRAINED; s->info = (sinfo) dmalloc (sizeof (*s->info)); - s->info->fname = fname; + s->info->fname = cstring_copy (fname); /* evans 2002-07-12: this was exposed, causing memory errors */ return (s); } @@ -5705,6 +5706,7 @@ void sRef_setFresh (sRef s, fileloc loc) sRef_checkMutable (s); s->aliaskind = AK_FRESH; s->aliasinfo = stateInfo_updateLoc (s->aliasinfo, loc); + DPRINTF (("SetFresh: %s", sRef_unparseFull (s))); } } @@ -6077,6 +6079,8 @@ void sRef_free (/*@only@*/ sRef s) DPRINTF (("Free sref: [%p]", s)); sRef_checkValid (s); + + multiVal_free (s->val); /* evans 2002-07-12 */ stateInfo_free (s->expinfo); stateInfo_free (s->aliasinfo); @@ -6086,7 +6090,7 @@ void sRef_free (/*@only@*/ sRef s) sRefSet_free (s->deriv); s->deriv = sRefSet_undefined; - /*@i43@*/ /* valueTable_free (s->state); */ + valueTable_free (s->state); sinfo_free (s); @@ -7749,8 +7753,7 @@ sRef_showRefKilled (sRef s) { if (sRef_hasStateInfoLoc (s)) { - llgenindentmsg (message ("Storage %q released", - sRef_unparse (s)), sRef_getStateInfoLoc (s)); + stateInfo_display (s->definfo, sRef_unparse (s)); } } @@ -8867,6 +8870,16 @@ static void { res->aliaskind = AK_KEPT; } + else if ((ares == AK_OWNED && aother == AK_ONLY) + || (aother == AK_OWNED && ares == AK_ONLY)) + { + res->aliaskind = AK_OWNED; + + if (aother == AK_OWNED) + { + res->aliasinfo = stateInfo_update (res->aliasinfo, other->aliasinfo); + } + } else { hasError = TRUE; @@ -9216,11 +9229,13 @@ static /*@null@*/ sinfo sinfo_copy (/*@notnull@*/ sRef s) ret = (sinfo) dmalloc (sizeof (*ret)); ret->spec = s->info->spec; break; + case SK_UNCONSTRAINED: case SK_NEW: ret = (sinfo) dmalloc (sizeof (*ret)); ret->fname = s->info->fname; break; + case SK_RESULT: case SK_CONST: case SK_TYPE: diff --git a/src/stateInfo.c b/src/stateInfo.c index 3d047fe..ffb2164 100644 --- a/src/stateInfo.c +++ b/src/stateInfo.c @@ -43,7 +43,7 @@ void stateInfo_free (/*@only@*/ stateInfo a) { if (old == NULL) { - old = stateInfo_copy (newinfo); + return stateInfo_copy (newinfo); } else if (newinfo == NULL) { @@ -52,12 +52,10 @@ void stateInfo_free (/*@only@*/ stateInfo a) } else { - old->loc = fileloc_update (old->loc, newinfo->loc); - old->ref = newinfo->ref; - old->ue = newinfo->ue; + stateInfo snew = stateInfo_makeRefLoc (newinfo->ref, newinfo->loc); + snew->previous = old; + return snew; } - - return old; } /*@only@*/ stateInfo stateInfo_updateLoc (/*@only@*/ stateInfo old, fileloc loc) @@ -69,7 +67,6 @@ void stateInfo_free (/*@only@*/ stateInfo a) else { old->loc = fileloc_update (old->loc, loc); - old->ue = uentry_undefined; old->ref = sRef_undefined; } @@ -86,7 +83,6 @@ void stateInfo_free (/*@only@*/ stateInfo a) else { old->loc = fileloc_update (old->loc, loc); - old->ue = uentry_undefined; old->ref = ref; } @@ -104,8 +100,8 @@ void stateInfo_free (/*@only@*/ stateInfo a) stateInfo ret = (stateInfo) dmalloc (sizeof (*ret)); ret->loc = fileloc_copy (a->loc); /*< should report bug without copy! >*/ - ret->ue = a->ue; ret->ref = a->ref; + ret->previous = stateInfo_copy (a->previous); return ret; } @@ -123,41 +119,68 @@ stateInfo_makeLoc (fileloc loc) stateInfo ret = (stateInfo) dmalloc (sizeof (*ret)); ret->loc = fileloc_copy (loc); /* don't need to copy! */ - ret->ue = uentry_undefined; ret->ref = sRef_undefined; - + ret->previous = stateInfo_undefined; + return ret; } /*@only@*/ stateInfo stateInfo_makeRefLoc (/*@exposed@*/ sRef ref, fileloc loc) + /*@post:isnull result->previous@*/ { stateInfo ret = (stateInfo) dmalloc (sizeof (*ret)); ret->loc = fileloc_copy (loc); ret->ref = ref; - ret->ue = uentry_undefined; - + ret->previous = stateInfo_undefined; + return ret; } /*@only@*/ cstring stateInfo_unparse (stateInfo s) { - if (stateInfo_isDefined (s) && - fileloc_isDefined (s->loc)) { - return fileloc_unparse (s->loc); - } else { + if (stateInfo_isDefined (s) && fileloc_isDefined (s->loc)) + { + if (stateInfo_isDefined (s->previous)) { + return message ("%q; %q", fileloc_unparse (s->loc), stateInfo_unparse (s->previous)); + } else { + return fileloc_unparse (s->loc); + } + } + else + { return cstring_makeLiteral (""); - } + } } fileloc stateInfo_getLoc (stateInfo info) { - if (stateInfo_isDefined (info)) { + if (stateInfo_isDefined (info)) + { return info->loc; + } + + return fileloc_undefined; +} + +void stateInfo_display (stateInfo s, cstring sname) +{ + while (stateInfo_isDefined (s)) + { + cstring msg = message ("Storage %s ", sname); + + if (sRef_isValid (s->ref)) { + msg = message ("%q through alias %q ", msg, sRef_unparse (s->ref)); + } + + msg = message ("%qreleased", msg); /* For now, just used for release...need to make this work. */ + llgenindentmsg (msg, s->loc); + s = s->previous; } - return fileloc_undefined; + cstring_free (sname); } + diff --git a/src/transferChecks.c b/src/transferChecks.c index 85c6148..4efa027 100644 --- a/src/transferChecks.c +++ b/src/transferChecks.c @@ -1724,7 +1724,8 @@ transferChecks_return (exprNode fexp, uentry rval) DPRINTF (("el: %s / %s", sRef_unparse (el), sRef_unparse (base))); - if (sRef_isResult (base)) + if (sRef_isResult (base) + && !sRef_isDefinitelyNull (fref)) /* evans 2002-07-22: don't report allocation errors for null results */ { sRef sr = sRef_fixBase (el, fref); diff --git a/src/uentry.c b/src/uentry.c index 3dee2e7..2624510 100644 --- a/src/uentry.c +++ b/src/uentry.c @@ -66,10 +66,8 @@ static void checkVarConformance (/*@notnull@*/ uentry p_old, bool p_mustConform, bool p_completeConform) /*@modifies p_old, p_unew@*/; -# ifndef NOLCL static void uentry_setHasMods (uentry p_ue) /*@modifies p_ue@*/; static void uentry_setHasGlobs (uentry p_ue) /*@modifies p_ue@*/; -# endif static void uentry_reallyFree (/*@notnull@*/ /*@only@*/ uentry p_e); @@ -687,7 +685,6 @@ static void uentry_setConstantValue (uentry ue, /*@only@*/ multiVal val) return ue; } -# ifndef NOLCL /*@notnull@*/ uentry uentry_makeSpecEnumConstant (cstring n, ctype t, fileloc loc) { uentry ue = uentry_makeConstant (n, t, loc); @@ -695,7 +692,6 @@ static void uentry_setConstantValue (uentry ue, /*@only@*/ multiVal val) ue->ukind = KENUMCONST; return ue; } -# endif /*@notnull@*/ uentry uentry_makeVariableLoc (cstring n, ctype t) { @@ -1336,7 +1332,6 @@ uentry_makeVariableParamAux (cstring n, ctype t, /*@dependent@*/ sRef s, return (e); } -# ifndef NOLCL void uentry_setRefCounted (uentry e) { @@ -1346,7 +1341,6 @@ uentry_setRefCounted (uentry e) sRef_storeState (e->sref); } } -# endif void uentry_setStatic (uentry c) @@ -3130,12 +3124,10 @@ uentry_isSpecialFunction (uentry ue) } } -# ifndef NOLCL /*@notnull@*/ uentry uentry_makeVariableParam (cstring n, ctype t, fileloc loc) { return (uentry_makeVariableParamAux (n, t, sRef_makeType (t), fileloc_copy (loc), SS_DEFINED)); } -# endif /* ** constants @@ -3684,7 +3676,6 @@ void uentry_addAccessType (uentry ue, typeId tid) FALSE, FALSE)); } -# ifndef NOLCL /*@notnull@*/ uentry uentry_makePrivFunction2 (cstring n, ctype t, typeIdSet access, @@ -3713,7 +3704,6 @@ void uentry_addAccessType (uentry ue, typeId tid) reflectImplicitFunctionQualifiers (ue, TRUE); return (ue); } -# endif uentry uentry_makeExpandedMacro (cstring s, fileloc f) { @@ -3752,7 +3742,6 @@ bool uentry_isForward (uentry e) return FALSE; } -# ifndef NOLCL /*@notnull@*/ uentry uentry_makeTypeListFunction (cstring n, typeIdSet access, fileloc f) { @@ -3773,7 +3762,6 @@ uentry_makeUnspecFunction (cstring n, ctype t, reflectImplicitFunctionQualifiers (ue, TRUE); return ue; } -# endif /* ** datatypes @@ -4000,7 +3988,6 @@ uentry_makeUnionTag (cstring n, ctype t, fileloc loc) return (ret); } -# ifndef NOLCL uentry uentry_makeEnumTag (cstring n, ctype t, fileloc loc) { @@ -4010,7 +3997,6 @@ uentry_makeEnumTag (cstring n, ctype t, fileloc loc) cstring_free (ename); return ret; } -# endif uentry uentry_makeUnionTagLoc (cstring n, ctype t) @@ -4470,7 +4456,6 @@ uentry_makeDatatypeBase (/*@only@*/ cstring name, ctype ct, ynm abstract, return (e); } -# ifndef NOLCL static void uentry_setHasGlobs (uentry ue) { llassert (uentry_isFunction (ue)); @@ -4484,7 +4469,6 @@ static void uentry_setHasMods (uentry ue) ue->info->fcn->hasMods = TRUE; } -# endif bool uentry_hasGlobs (uentry ue) { @@ -5742,27 +5726,35 @@ uentry_getGlobs (uentry l) return globSet_undefined; } - if (l->ukind != KFCN) + if (uentry_isFunction (l)) + { + return l->info->fcn->globs; + } + else if (uentry_isIter (l)) { - if (l->ukind != KITER && l->ukind != KENDITER) + return l->info->iter->globs; + } + else if (uentry_isEndIter (l)) + { + return globSet_undefined; + } + else + { + if (l->ukind == KVAR) { - if (l->ukind == KVAR) - { - llbug (message ("Bad call to uentry_getGlobs (var): %q (%s)", + llcontbug (message ("Bad call to uentry_getGlobs (var): %q (%s)", uentry_unparse (l), ekind_unparse (l->ukind))); - } - else - { - llbug (message ("Bad call to uentry_getGlobs: %q (%s)", + } + else + { + llcontbug (message ("Bad call to uentry_getGlobs: %q (%s)", uentry_unparse (l), ekind_unparse (l->ukind))); - } } + return globSet_undefined; } - - return l->info->fcn->globs; } /*@observer@*/ sRefSet @@ -5776,7 +5768,22 @@ uentry_getMods (uentry l) return sRefSet_undefined; } - return l->info->fcn->mods; + if (uentry_isFunction (l)) + { + return l->info->fcn->mods; + } + else if (uentry_isIter (l)) + { + return l->info->iter->mods; + } + else if (uentry_isEndIter (l)) + { + return sRefSet_undefined; + } + else + { + BADBRANCH; + } } ekind @@ -6797,7 +6804,7 @@ uentry_reallyFree (/*@notnull@*/ /*@only@*/ uentry e) nuentries--; sfree (e); - } +} extern void uentry_markOwned (/*@owned@*/ uentry u) { @@ -9900,10 +9907,10 @@ static void uentry_updateInto (/*@unique@*/ uentry unew, uentry old) unew->info = uinfo_copy (old->info, old->ukind); } - -uentry -uentry_copy (uentry e) +static uentry +uentry_copyAux (uentry e, bool saveCopy) { + if (uentry_isValid (e)) { uentry enew = uentry_alloc (); @@ -9916,7 +9923,15 @@ uentry_copy (uentry e) enew->whereDefined = fileloc_copy (e->whereDefined); enew->whereDeclared = fileloc_copy (e->whereDeclared); - enew->sref = sRef_saveCopy (e->sref); /* Memory leak! */ + if (saveCopy) + { + enew->sref = sRef_saveCopy (e->sref); /* Memory leak! */ + } + else + { + enew->sref = sRef_copy (e->sref); + } + enew->used = e->used; enew->lset = FALSE; enew->isPrivate = e->isPrivate; @@ -9939,6 +9954,18 @@ uentry_copy (uentry e) } } +uentry +uentry_copy (uentry e) +{ + return uentry_copyAux (e, TRUE); +} + +uentry +uentry_copyNoSave (uentry e) +{ + return uentry_copyAux (e, FALSE); +} + void uentry_setState (uentry res, uentry other) { @@ -10840,7 +10867,7 @@ bool uentry_isReturned (uentry u) } # endif -/*@exposed@*/ sRef uentry_returnedRef (uentry u, exprNodeList args) +/*@exposed@*/ sRef uentry_returnedRef (uentry u, exprNodeList args, fileloc loc) { llassert (uentry_isRealFunction (u)); @@ -10850,7 +10877,7 @@ bool uentry_isReturned (uentry u) sRef res = sRef_makeNew (ctype_getReturnType (u->utype), u->sref, u->uname); DPRINTF (("Returned: %s", sRef_unparseFull (res))); - sRef_setAllocated (res, g_currentloc); + sRef_setAllocated (res, loc); DPRINTF (("ensures clause: %s / %s", uentry_unparse (u), stateClauseList_unparse (clauses))); @@ -10875,7 +10902,7 @@ bool uentry_isReturned (uentry u) if (modf != NULL) { sRef sr = sRef_fixBase (el, res); - modf (sr, g_currentloc); + modf (sr, loc); } } else @@ -10915,19 +10942,25 @@ bool uentry_isReturned (uentry u) usymtab_addForceMustAlias (tcref, tref); /* evans 2001-05-27 */ + if (sRef_isNew (tcref)) + { + /* tcref->kind = SK_OBJECT; */ /*!! Not new anymore */ + } + if (sRef_isDead (tcref)) { - sRef_setDefined (tcref, g_currentloc); - sRef_setOnly (tcref, g_currentloc); + sRef_setDefined (tcref, loc); + sRef_setOnly (tcref, loc); } if (sRef_isRefCounted (tcref)) { /* could be a new ref now (but only if its returned) */ - sRef_setAliasKindComplete (tcref, AK_ERROR, g_currentloc); + sRef_setAliasKindComplete (tcref, AK_ERROR, loc); } sRef_makeSafe (tcref); + DPRINTF (("Returns tcref / %s", sRef_unparseFull (tcref))); prefs = sRefSet_insert (prefs, tcref); } } @@ -10952,7 +10985,7 @@ bool uentry_isReturned (uentry u) if (nstate_isKnown (n)) { - sRef_setNullState (res, n, g_currentloc); + sRef_setNullState (res, n, loc); } } else @@ -10969,7 +11002,7 @@ bool uentry_isReturned (uentry u) if (sRef_isRefCounted (res)) { - sRef_setAliasKind (res, AK_NEWREF, g_currentloc); + sRef_setAliasKind (res, AK_NEWREF, loc); } } @@ -10980,7 +11013,7 @@ bool uentry_isReturned (uentry u) if (ctype_isAbstract (ct)) { - sRef_setNotNull (res, g_currentloc); + sRef_setNotNull (res, loc); } else { @@ -10990,18 +11023,18 @@ bool uentry_isReturned (uentry u) } else { - sRef_setNotNull (res, g_currentloc); + sRef_setNotNull (res, loc); } } } if (sRef_isRefCounted (res)) { - sRef_setAliasKind (res, AK_NEWREF, g_currentloc); + sRef_setAliasKind (res, AK_NEWREF, loc); } else if (sRef_isKillRef (res)) { - sRef_setAliasKind (res, AK_REFCOUNTED, g_currentloc); + sRef_setAliasKind (res, AK_REFCOUNTED, loc); } else { @@ -11014,11 +11047,18 @@ bool uentry_isReturned (uentry u) { sRef_setAliasKind (res, alkind_fixImplicit (ak), - g_currentloc); + loc); } sRefSet_free (prefs); - + + /* + if (sRef_isOnly (res)) + { + sRef_setFresh (res, loc); + } + */ + DPRINTF (("Returns ref: %s", sRef_unparseFull (res))); return res; } diff --git a/src/usymtab.c b/src/usymtab.c index 7d4ccd1..1f70646 100644 --- a/src/usymtab.c +++ b/src/usymtab.c @@ -105,6 +105,10 @@ static bool usymtab_isAltDefinitelyNull (sRef p_s) /*@globals utab@*/ ; static void refTable_free (/*@only@*/ /*@null@*/ refTable p_x, int p_nentries); static ctype usymtab_suFieldsType (uentryList p_f, bool p_isStruct) /*@globals globtab@*/ ; +static void usymtab_freeAux (/*@only@*/ usymtab p_u) + /*@globals globtab, utab, filetab@*/ + /*@modifies p_u@*/ ; + extern int usymtab_getCurrentDepth (void) /*@globals utab@*/ { return utab->lexlevel; @@ -297,7 +301,8 @@ static /*@notnull@*/ /*@special@*/ usymtab t->mustBreak = FALSE; t->exitCode = XK_NEVERESCAPE; - + + DPRINTF (("Create usymtab [%p]", t)); return t; } @@ -339,6 +344,13 @@ usymtab_initMod (void) oldtab = usymtab_undefined; } +void +usymtab_destroyMod (void) /*@modifies utab, globtab, filetab@*/ /*@globals killed utab@*/ +{ + DPRINTF (("Destroy usymtab [%p]: %d", utab, utab->nentries)); + usymtab_freeAux (utab); + utab = usymtab_undefined; +} void usymtab_initGlobalMarker () /*@globals globtab@*/ @@ -1019,7 +1031,6 @@ usymtab_supEntryAux (/*@notnull@*/ usymtab st, return (staticEntry ? USYMIDINVALID : eindex); } -# ifndef NOLCL static void usymtab_replaceEntryAux (/*@notnull@*/ usymtab st, /*@only@*/ uentry e) /*@globals globtab@*/ /*@modifies st, e@*/ @@ -1048,7 +1059,6 @@ usymtab_replaceEntryAux (/*@notnull@*/ usymtab st, /*@only@*/ uentry e) eindex = usymtab_addEntryAux (st, e, FALSE); } } -# endif /*@=deparrays@*/ @@ -1266,7 +1276,6 @@ usymtab_supAbstractTypeEntry (/*@only@*/ uentry e, bool dodef) return (uid); } -# ifndef NOLCL usymId usymtab_supExposedTypeEntry (/*@only@*/ uentry e, bool dodef) /*@globals globtab, filetab@*/ @@ -1290,7 +1299,6 @@ usymtab_supExposedTypeEntry (/*@only@*/ uentry e, bool dodef) return (uid); } -# endif ctype usymtab_supForwardTypeEntry (/*@only@*/ uentry e) @@ -2009,9 +2017,10 @@ void usymtab_load (FILE *f) I'm trying to do this without breaking older libraries*/ /*check for "optional" start buffer constraints message*/ - if (cstring_compareLit(cstring_fromChars(s), "start_Buffer_Constraints\n") == 0 ) + + if (mstring_equalPrefix (s, "start_Buffer_Constraints")) { - (void)fgets (s, MAX_DUMP_LINE_LENGTH, f); + (void) fgets (s, MAX_DUMP_LINE_LENGTH, f); } while (s != NULL && *s != ';') @@ -4337,6 +4346,8 @@ usymtab_quietExitScope (fileloc loc) { usymtab t = utab->env; + DPRINTF (("Quiet exit scope [%p]", utab)); + if (utab->reftable != NULL) { int i; @@ -4363,6 +4374,7 @@ usymtab_quietExitScope (fileloc loc) t->mustBreak = utab->mustBreak; t->exitCode = utab->exitCode; + DPRINTF (("Free level [%p]", utab)); usymtab_freeLevel (utab); utab = t; @@ -4397,7 +4409,7 @@ void usymtab_exitScope (exprNode expr) usymtab lctab = usymtab_undefined; bool mustReturn = exprNode_mustEscape (expr); - DPRINTF (("Exit scope")); + DPRINTF (("Exit scope [%p]", utab)); if (utab->kind == US_CBRANCH) { @@ -4893,7 +4905,15 @@ usymtab_addRefEntry (/*@notnull@*/ usymtab s, cstring k) uentry ue; DPRINTF (("Here: copying %s", uentry_unparse (current))); - ue = uentry_copy (current); + if (uentry_isNonLocal (current)) + { + ue = uentry_copy (current); + } + else + { + ue = uentry_copyNoSave (current); + } + DPRINTF (("Here: copying %s", uentry_unparse (ue))); usymtab_addEntryQuiet (ut, ue); DPRINTF (("Okay...")); @@ -5080,7 +5100,6 @@ uentry usymtab_lookupEither (cstring k) return ce; } -# ifndef NOLCL ctype usymtab_lookupType (cstring k) /*@globals globtab@*/ @@ -5095,7 +5114,6 @@ usymtab_lookupType (cstring k) return (uentry_getRealType (usymtab_getTypeEntry (uid))); } -# endif ctype usymtab_lookupAbstractType (cstring k) /*@globals globtab@*/ @@ -5230,7 +5248,6 @@ bool return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce))); } -# ifndef NOLCL bool usymtab_existsEither (cstring k) /*@globals utab@*/ @@ -5248,7 +5265,6 @@ bool return (uentry_isValid (ce)); } -# endif bool usymtab_existsType (cstring k) @@ -5298,7 +5314,6 @@ usymtab_existsEnumTag (cstring k) /*@globals globtab@*/ return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce))); } -# ifndef NOLCL bool usymtab_existsVar (cstring k) /*@globals utab@*/ { @@ -5306,7 +5321,6 @@ bool usymtab_existsVar (cstring k) return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)) && (uentry_isVar (ce))); } -# endif /* ** destructors @@ -5334,6 +5348,7 @@ usymtab_freeLevel (/*@notnull@*/ /*@only@*/ usymtab u) { int i; + DPRINTF (("Free level [%p]", u)); aliasTable_free (u->aliases); refTable_free (u->reftable, u->nentries); @@ -5342,7 +5357,10 @@ usymtab_freeLevel (/*@notnull@*/ /*@only@*/ usymtab u) { for (i = 0; i < u->nentries; i++) { + DPRINTF (("Free complete: %d", i)); + DPRINTF (("Uentry: %s", uentry_unparse (u->entries[i]))); uentry_freeComplete (u->entries[i]); + u->entries[i] = uentry_undefined; } } else @@ -5350,6 +5368,7 @@ usymtab_freeLevel (/*@notnull@*/ /*@only@*/ usymtab u) for (i = 0; i < u->nentries; i++) { uentry_free (u->entries[i]); + u->entries[i] = uentry_undefined; } } @@ -5361,11 +5380,11 @@ usymtab_freeLevel (/*@notnull@*/ /*@only@*/ usymtab u) && u != filetab) { llassert (!cstringTable_isDefined (u->htable)); - sfree (u); } -/*@-mustfree@*/ -} /*@=mustfree@*/ + sfree (u); /* evans 2002-07-12: was inside if */ + /*:!!mustfree@*/ +} /*!@=mustfree@*/ static void usymtab_freeAux (/*@only@*/ usymtab u) @@ -5388,6 +5407,7 @@ void usymtab_free () { dbgfree = TRUE; usymtab_freeAux (utab); + utab = usymtab_undefined; } static int usymtab_lexicalLevel (void) /*@globals utab@*/ @@ -5410,7 +5430,6 @@ bool usymtab_inFunctionScope () /*@globals utab@*/ return (utab->lexlevel == functionScope); } -# ifndef NOLCL void usymtab_replaceEntry (uentry s) /*@globals utab, globtab@*/ @@ -5418,7 +5437,6 @@ usymtab_replaceEntry (uentry s) { usymtab_replaceEntryAux (utab, s); } -# endif bool usymtab_matchForwardStruct (usymId u1, usymId u2) diff --git a/test/Makefile.am b/test/Makefile.am index a96678f..4cdebe2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -13,6 +13,7 @@ DIFFFLAGS = ## Set up the splint commands +#SPLINT = valgrind --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=no $(top_builddir)/src/splint$(EXEEXT) SPLINT = $(top_builddir)/src/splint$(EXEEXT) ### These are shell-specific @@ -20,8 +21,8 @@ SPLINT = $(top_builddir)/src/splint$(EXEEXT) ## unexport LCLIMPORTDIR ### This is horrible! Can't we make top_builddir absolute? +#SPLINTNEST = valgrind --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=no ../$(top_builddir)/src/splint$(EXEEXT) SPLINTNEST = ../$(top_builddir)/src/splint$(EXEEXT) - SPLINTPNEST = @$(SPLINTNEST) -nof SPLINTP = @$(SPLINT) -nof @@ -48,7 +49,7 @@ UNITTESTS = \ macros macrosef merge mergenull modifies modtest moduncon \ mongoincludes mystrncat noeffect null observer oldstyle outglob outparam \ parentype postnotnull preds prefixes printflike rc refcounts release repexpose \ - returned sharing shifts slovaknames \ + returned sharing shifts sizesigns slovaknames \ specclauses \ special stack staticarray strings \ stringliteral \ @@ -723,6 +724,13 @@ shifts: -$(SPLINTR) shifts.c -shiftimplementation -expect 3 -$(SPLINTR) shifts.c -shiftnegative -expect 1 +### evans - added 2002-08-17: check warnings with arbitrary integral types +sizesigns: + -$(SPLINTR) +strict sizesigns.c + -$(SPLINTR) +strict +ignoresigns sizesigns.c + -$(SPLINTR) +strict +matcharbitraryintegral sizesigns.c + -$(SPLINTR) +strict +matcharbitraryintegral +ignoresignz sizesigns.c + .PHONY: slovaknames slovaknames: -$(SPLINTR) +hints slovaknames.c -expect 1 @@ -731,11 +739,15 @@ slovaknames: -$(SPLINTR) +hints +slovak -slovakvars slovaknames.c -expect 2 -$(SPLINTR) +hints +slovak -accessslovak slovaknames.c -expect 7 +## +## evans 2002-07-22: 1 less warning for specclauses3.c because of NULL result +## + .PHONY: specclauses specclauses: -$(SPLINTR) specclauses.c -expect 6 -$(SPLINTR) specclauses2.c -expect 8 - -$(SPLINTR) specclauses3.c -expect 6 + -$(SPLINTR) specclauses3.c -expect 5 -$(SPLINTR) specclauses4.c -expect 3 -$(SPLINTR) specclauses5.c -expect 3 @@ -1557,6 +1569,7 @@ EXTRA_DIST = ./abst_t.lcl ./abst_t.lcs \ utypes.expect widestrings.expect widestrings.c \ functionmacro.expect functionmacro.c info.c info.expect \ loopexec.c looptesteffect.c mergenull.c shifts.c \ + sizesigns.c sizesigns.expect \ manual.expect ./manual/Makefile \ ./manual/annotglobs.c ./manual/bool.c ./manual/bool.h ./manual/clauses.c ./manual/employee.h ./manual/exposure.c ./manual/globals.c ./manual/ignore.c ./manual/implicit.c ./manual/intSet.h ./manual/list.c ./manual/loop.c ./manual/macros.c ./manual/modify.c ./manual/mstring.c ./manual/mstring.h ./manual/mstringnn.c ./manual/multiError.c ./manual/names.c ./manual/noeffect.c ./manual/null.c ./manual/only.c ./manual/order.c ./manual/palindrome.c ./manual/palindrome.h ./manual/refs.c ./manual/returned.c ./manual/rgb.c ./manual/rstring.c ./manual/rstring.h ./manual/sample.c ./manual/setChar.c ./manual/setname.c ./manual/setname.h ./manual/special.c ./manual/stack.c ./manual/sumsquares.c ./manual/switch.c ./manual/testpal.c ./manual/types.c ./manual/unique.c ./manual/usedef.c ./manual/bounds.c \ arraydims.expect arraydims.c \ diff --git a/test/Makefile.in b/test/Makefile.in index de41dde..fd5610b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -80,6 +80,7 @@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RM = @RM@ +SED = @SED@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ @@ -89,17 +90,18 @@ AUTOMAKE_OPTIONS = 1.5 foreign DIFFFLAGS = - # -u show context #drl 3/27/2002 get the test suit to print a warning when splint is built under /usr/ + +#SPLINT = valgrind --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=no $(top_builddir)/src/splint$(EXEEXT) SPLINT = $(top_builddir)/src/splint$(EXEEXT) ### These are shell-specific ### This is horrible! Can't we make top_builddir absolute? +#SPLINTNEST = valgrind --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=no ../$(top_builddir)/src/splint$(EXEEXT) SPLINTNEST = ../$(top_builddir)/src/splint$(EXEEXT) - SPLINTPNEST = @$(SPLINTNEST) -nof SPLINTP = @$(SPLINT) -nof @@ -1557,7 +1559,7 @@ slovaknames: specclauses: -$(SPLINTR) specclauses.c -expect 6 -$(SPLINTR) specclauses2.c -expect 8 - -$(SPLINTR) specclauses3.c -expect 6 + -$(SPLINTR) specclauses3.c -expect 5 -$(SPLINTR) specclauses4.c -expect 3 -$(SPLINTR) specclauses5.c -expect 3 diff --git a/test/db2.expect b/test/db2.expect index d8b1b5f..2817986 100644 --- a/test/db2.expect +++ b/test/db2.expect @@ -9,10 +9,10 @@ eref.c:29: Unqualified storage eref_Pool.status passed as only param: realloc (eref_Pool.status, ...) eref.c:45: Storage eref_Pool.status reachable from global is only (should be unqualified) - eref.c:30: Storage eref_Pool.status becomes only + eref.c:29: Storage eref_Pool.status becomes only eref.c:45: Storage eref_Pool.conts reachable from global is only (should be unqualified) - eref.c:20: Storage eref_Pool.conts becomes only + eref.c:19: Storage eref_Pool.conts becomes only eref.c: (in function eref_initMod) eref.c:84: Storage eref_Pool.conts reachable from global is fresh (should be unqualified) diff --git a/test/specclauses.expect b/test/specclauses.expect index d982d1c..137cc8b 100644 --- a/test/specclauses.expect +++ b/test/specclauses.expect @@ -45,8 +45,6 @@ Finished checking --- 8 code warnings, as expected specclauses3.c:7:6: Special clause accesses field of non-struct or union result (int): *(result).name specclauses3.c: (in function badResult) -specclauses3.c:12:10: Undefined storage >->name corresponds to - storage result->name listed in defines clause: NULL specclauses3.c:12:10: Null storage returned as non-null: NULL specclauses3.c: (in function createName2) specclauses3.c:29:10: Undefined storage res->name corresponds to storage @@ -57,7 +55,7 @@ specclauses3.c: (in function createName4) specclauses3.c:55:10: Unallocated storage res->name corresponds to storage result->name listed in allocates clause: res -Finished checking --- 6 code warnings, as expected +Finished checking --- 5 code warnings, as expected specclauses4.c: (in function usename) specclauses4.c:13:4: Dereference of null pointer *name: **name @@ -80,6 +78,6 @@ specclauses5.c:43:10: Non-observer storage r->name corresponds to storage specclauses5.c: (in function createrecordx) specclauses5.c:49:10: Observer storage r->name reachable from unqualified return value - specclauses5.c:48:27: Storage r->name becomes observer + specclauses5.c:48:14: Storage r->name becomes observer Finished checking --- 3 code warnings, as expected -- 2.45.2