]> andersk Git - splint.git/commitdiff
Committed to enable merge.
authorevans1629 <evans1629>
Fri, 31 May 2002 20:33:14 +0000 (20:33 +0000)
committerevans1629 <evans1629>
Fri, 31 May 2002 20:33:14 +0000 (20:33 +0000)
45 files changed:
lib/unix.h
src/Headers/basic.h
src/Headers/cstringList.h
src/Headers/cstringSList.h
src/Headers/ctypeList.h
src/Headers/fileIdList.h
src/Headers/flags.h
src/Headers/forwardTypes.h
src/Headers/help.h [new file with mode: 0644]
src/Headers/lclinit.h
src/Headers/lctype.h
src/Headers/llmain.h
src/Headers/lslinit.h
src/Headers/osd.h
src/Headers/rcfiles.h [new file with mode: 0644]
src/Makefile.am
src/Makefile.in
src/clabstract.c
src/context.c
src/cpplib.c
src/cppmain.c
src/cscanner.l
src/cstringList.c
src/ctype.c
src/fileIdList.c
src/fileTable.c
src/fileloc.c
src/flags.c
src/help.c [new file with mode: 0644]
src/lclinit.c
src/llerror.c
src/llmain.c
src/lslinit.c [deleted file]
src/osd.c
src/rcfiles.c [new file with mode: 0644]
src/uentry.c
src/usymtab.c
test/Makefile.am
test/Makefile.in
test/clauses.expect
test/enumtag.c [new file with mode: 0644]
test/enumtag.expect [new file with mode: 0644]
test/exports.expect
test/flags.expect
test/rc.expect

index 00e01fc4e790c506fb38ae7e41c5d9289c965cc2..ea5cb0304849e713119a5a4f096d4699ff6867fe 100644 (file)
@@ -290,22 +290,24 @@ int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg)
 
 pid_t vfork (void) /*@modifies fileSystem@*/ ;
 
+/*
+** sys/uio.h
+*/
 
 struct iovec {
-  void    *iov_base;
-  size_t   iov_len;
+  void *iov_base;
+  size_t iov_len; /*: maxSet(iov_base) = iov_len */
 };
 
+/* from limits.h */
 /*@constant int UIO_MAXIOV@*/   /* BSD */
 /*@constant int IOV_MAX@*/      /* supposedly SVR4 */
 
-       extern ssize_t
-readv (int fd, const struct iovec iov[], int iovcnt)
-       /*@modifies iov[].iov_base, fileSystem, errno@*/;
+ssize_t readv (int fd, const struct iovec *iov, int iovcnt)
+     /*@modifies iov->iov_base, fileSystem, errno@*/;
 
-       extern ssize_t
-writev (int fd, const struct iovec iov[], int iovcnt)
-       /*@modifies errno@*/;
+ssize_t writev (int fd, const struct iovec *iov, int iovcnt)
+     /*@modifies errno@*/;
 
 /*________________________________________________________________________
  * poll.h
@@ -343,34 +345,34 @@ extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/
  * sys/socket.h
  */
 
-/*@constant int SOCK_STREAM@*/
-/*@constant int SOCK_DGRAM@*/
-/*@constant int SOCK_RAW@*/
+
+
+
 /*@constant int SOCK_RDM@*/
-/*@constant int SOCK_SEQPACKET@*/
-/*@constant int SO_DEBUG@*/
-/*@constant int SO_ACCEPTCONN@*/
-/*@constant int SO_REUSEADDR@*/
-/*@constant int SO_KEEPALIVE@*/
-/*@constant int SO_DONTROUTE@*/
-/*@constant int SO_BROADCAST@*/
+
+
+
+
+
+
+
 /*@constant int SO_USELOOPBACK@*/
-/*@constant int SO_LINGER@*/
-/*@constant int SO_OOBINLINE@*/
+
+
 /*@constant int SO_REUSEPORT@*/
-/*@constant int SO_SNDBUF@*/
-/*@constant int SO_RCVBUF@*/
-/*@constant int SO_SNDLOWAT@*/
-/*@constant int SO_RCVLOWAT@*/
-/*@constant int SO_SNDTIMEO@*/
-/*@constant int SO_RCVTIMEO@*/
-/*@constant int SO_ERROR@*/
-/*@constant int SO_TYPE@*/
-/*@constant int SOL_SOCKET@*/
-/*@constant int AF_UNSPEC@*/
+
+
+
+
+
+
+
+
+
+
 /*@constant int AF_LOCAL@*/
-/*@constant int AF_UNIX@*/
-/*@constant int AF_INET@*/
+
+
 /*@constant int AF_IMPLINK@*/
 /*@constant int AF_PUP@*/
 /*@constant int AF_CHAOS@*/
@@ -398,13 +400,12 @@ extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/
 /*@constant int AF_ISDN@*/
 /*@constant int AF_E164@*/
 /*@constant int AF_MAX@*/
-/*@constant int MSG_OOB@*/
-/*@constant int MSG_PEEK@*/
-/*@constant int MSG_DONTROUTE@*/
-/*@constant int MSG_EOR@*/
-/*@constant int MSG_TRUNC@*/
-/*@constant int MSG_CTRUNC@*/
-/*@constant int MSG_WAITALL@*/
+
+
+
+
+
+
 /*@constant int MSG_DONTWAIT@*/
 /*@constant int MSG_EOF@*/
 /*@constant int MSG_COMPAT@*/
@@ -443,58 +444,119 @@ extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/
 /*@constant int NET_RT_FLAGS@*/
 /*@constant int NET_RT_IFLIST@*/
 /*@constant int NET_RT_MAXID@*/
-/*@constant int SOMAXCONN@*/
-/*@constant int SCM_RIGHTS@*/
 
- struct sockaddr {
-       u_char  sa_len;                 /* total length */
-       u_char  sa_family;              /* address family */
-       char    sa_data[14];            /* actually longer; address value */
-};
 
- struct linger {
-       int     l_onoff;                /* option on/off */
-       int     l_linger;               /* linger time */
-};
 
- struct sockproto {
-       u_short sp_family;              /* address family */
-       u_short sp_protocol;            /* protocol */
+/*
+** sys/socket.h
+** (updated 26 May 2002)
+*/
+
+typedef /*@unsignedintegraltype@*/ socklen_t;
+
+struct sockaddr {
+  sa_family_t  sa_family;              /* address family */
+  char          sa_data[];             /* variable length */
 };
- struct msghdr {
-       caddr_t msg_name;               /* optional address */
-       u_int   msg_namelen;            /* size of address */
-       struct  iovec *msg_iov;         /* scatter/gather array */
-       u_int   msg_iovlen;             /* # elements in msg_iov */
-       caddr_t msg_control;            /* ancillary data, see below */
-       u_int   msg_controllen;         /* ancillary data buffer len */
-       int     msg_flags;              /* flags on received message */
+
+struct sockaddr_storage {
+  sa_family_t ss_family;
+} ;
+
+struct msghdr {
+  void *msg_name;              
+  socklen_t msg_namelen;       /*: maxSet (msg_name) >= msg_namelen */
+  struct iovec *msg_iov;       /* scatter/gather array */
+  int msg_iovlen;              /* # elements in msg_iov */ /*: maxSet (msg_iov) >= msg_iovlen */
+  void *msg_control;           /* ancillary data, see below */
+  socklen_t msg_controllen;     /*: maxSet (msg_control) >= msg_controllen */
+  int msg_flags;               /* flags on received message */
+} ;
+
+struct cmsghdr {
+  socklen_t cmsg_len;          /* data byte count, including hdr */
+  int cmsg_level;              /* originating protocol */
+  int cmsg_type;               /* protocol-specific type */
+} ;
+
+/*@constant int SCM_RIGHTS@*/
+
+/*@exposed@*/ unsigned char *CMSG_DATA (/*@sef@*/ struct cmsghdr *) /*@*/ ;
+/*@null@*/ /*@exposed@*/ struct cmsghdr *CMSG_NXTHDR (struct msghdr *, struct cmsghdr *) /*@*/ ;
+/*@null@*/ /*@exposed@*/ struct cmsghdr *CMSG_FIRSTHDR (struct msghdr *) /*@*/ ;
+
+struct linger {
+  int l_onoff; 
+  int l_linger;        
 };
 
- struct cmsghdr {
-       u_int   cmsg_len;               /* data byte count, including hdr */
-       int     cmsg_level;             /* originating protocol */
-       int     cmsg_type;              /* protocol-specific type */
-/* followed by u_char  cmsg_data[]; */
+/*@constant int SOCK_DGRAM@*/
+/*@constant int SOCK_RAW@*/
+/*@constant int SOCK_SEQPACKET@*/
+/*@constant int SOCK_STREAM@*/
+
+/*@constant int SOL_SOCKET@*/
+
+/*@constant int SO_ACCEPTCONN@*/
+/*@constant int SO_BROADCAST@*/
+/*@constant int SO_DEBUG@*/
+/*@constant int SO_DONTROUTE@*/
+/*@constant int SO_ERROR@*/
+/*@constant int SO_KEEPALIVE@*/
+/*@constant int SO_LINGER@*/
+/*@constant int SO_OOBINLINE@*/
+/*@constant int SO_RCVBUF@*/
+/*@constant int SO_RCVLOWAT@*/
+/*@constant int SO_RCVTIMEO@*/
+/*@constant int SO_REUSEADDR@*/
+/*@constant int SO_SNDBUF@*/
+/*@constant int SO_SNDLOWAT@*/
+/*@constant int SO_SNDTIMEO@*/
+/*@constant int SO_TYPE@*/
+
+/*@constant int SOMAXCONN@*/
+
+/*@constant int MSG_CTRUNC@*/
+/*@constant int MSG_DONTROUTE@*/
+/*@constant int MSG_EOR@*/
+/*@constant int MSG_OOB@*/
+/*@constant int MSG_PEEK@*/
+/*@constant int MSG_TRUNC@*/
+/*@constant int MSG_WAITALL@*/
+
+/*@constant int AF_INET@*/
+/*@constant int AF_INET6@*/
+/*@constant int AF_UNIX@*/
+/*@constant int AF_UNSPEC@*/
+
+/*@constant int SHUT_RD@*/
+/*@constant int SHUT_RDWR@*/
+/*@constant int SHUT_WR@*/
+
+# if 0
+/*
+** These were in the old unix.h spec, but are not in SUS6
+*/
+
+struct sockproto {
+  u_short      sp_family;              /* address family */
+  u_short      sp_protocol;            /* protocol */
 };
 
-       extern int
-accept (int s, struct sockaddr *addr, int *addrlen)
-       /*@modifies *addrlen, errno@*/;
+# endif
 
-       extern int
-bind (int s, struct sockaddr *name, int namelen)
-       /*@modifies errno, fileSystem@*/;
+int accept (int s, struct sockaddr *addr, int *addrlen)
+  /*@modifies *addrlen, errno@*/;
 
-       extern int
-connect (int s, struct sockaddr *name, int namelen)
-       /*@modifies errno, internalState@*/;
+int bind (int s, const struct sockaddr *name, int namelen)
+  /*@modifies errno, fileSystem@*/;
 
-int getpeername (int s, /*@out@*/ struct sockaddr *name, size_t *namelen)
-       /*@modifies *name, *namelen, errno@*/;
-       
-       typedef /*@unsignedintegraltype@*/ socklen_t;
+int connect (int s, const struct sockaddr *name, int namelen)
+  /*@modifies errno, internalState@*/;
 
+int getpeername (int s, /*@out@*/ struct sockaddr *restrict name, socklen_t *restrict namelen)
+   /*@modifies *name, *namelen, errno@*/;
+       
 #ifdef STRICT
 
 int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t *address_len)
@@ -856,46 +918,37 @@ int gethostname (/*@out@*/ char *address, size_t address_len)
 int initgroups (const char *name, int basegid)
    /*@modifies internalState@*/;
 
-       extern int
-lchown (const char *path, uid_t owner, gid_t group)
-       /*@modifies errno, fileSystem@*/;
-
-       extern int
-select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t)
-       /*@modifies *r, *w, *e, *t, errno@*/;
-
-       extern int
-setegid (gid_t egid)
-       /*@modifies errno, internalState@*/;
-
-       extern int
-seteuid (uid_t euid)
-       /*@modifies errno, internalState@*/;
-
-       extern int
-setgroups (int ngroups, const gid_t *gidset)
-       /*@modifies errno, internalState@*/;
-
-       extern int
-setregid (gid_t rgid, gid_t egid)
-       /*@modifies errno, internalState@*/;
-
-       extern int
-setreuid (gid_t ruid, gid_t euid)
-       /*@modifies errno, internalState@*/;
-
-       extern void
-sync (void)
-       /*@modifies fileSystem@*/;
+int lchown (const char *path, uid_t owner, gid_t group)
+     /*@modifies errno, fileSystem@*/;
+     
+int select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, /*@null@*/ struct timeval *t)
+     /*@modifies *r, *w, *e, *t, errno@*/;
+     /* evans - 2002-05-26: added null for t, bug reported by Enrico Scholz */
 
-       extern int
-symlink (const char *path, const char *path2)
-       /*@modifies fileSystem@*/;
-
-       extern int
-truncate (const char *name, off_t length)
-       /*@modifies errno, fileSystem@*/;
+int setegid (gid_t egid)
+     /*@modifies errno, internalState@*/;
 
+int seteuid (uid_t euid)
+     /*@modifies errno, internalState@*/;
+     
+int setgroups (int ngroups, const gid_t *gidset)
+     /*@modifies errno, internalState@*/;
+     
+int setregid (gid_t rgid, gid_t egid)
+     /*@modifies errno, internalState@*/;
+     
+int setreuid (gid_t ruid, gid_t euid)
+     /*@modifies errno, internalState@*/;
+     
+void sync (void)
+     /*@modifies fileSystem@*/;
+     
+int symlink (const char *path, const char *path2)
+     /*@modifies fileSystem@*/;
+     
+int truncate (const char *name, off_t length)
+     /*@modifies errno, fileSystem@*/;
+     
 /*@constant int EBADRPC@*/
 /*@constant int ERPCMISMATCH@*/
 /*@constant int EPROGUNAVAIL@*/
index 79cf80dea6f3e4ec48982d8c56b660eececb0509..b6007cd5991ed983e2bbd15cc6514d50f365251a 100644 (file)
 # include "stateCombinationTable.h"
 # include "mtincludes.h"
 # include "functionConstraint.h"
+# include "fileIdList.h"
 
 # include "context.h"
 # include "constants.h"
index c0766463957a12ec2f8a33b9037decf7e63847ee..617ad97137b6c44cd3964d54e549c90e539ff476 100644 (file)
@@ -27,6 +27,8 @@ extern /*@unused@*/ /*@falsewhennull@*/ bool cstringList_empty (/*@sef@*/ cstrin
 
 extern cstring cstringList_unparseSep (cstringList p_s, cstring p_sep) /*@*/ ;
 
+extern /*@exposed@*/ /*@null@*/ bn_mstring *cstringList_getElements (cstringList) /*@*/ ;
+
 extern /*@unused@*/ /*@only@*/ cstringList cstringList_new (void) /*@*/ ;
 
 extern /*@only@*/ cstringList cstringList_single (/*@keep@*/ cstring p_el) /*@*/ ;
index 03c51dd9471dec5a11c16a4f6bdf192810fc6e95..a1bf382847c9cd25e2be4ab96679e952eeb7c202 100644 (file)
@@ -8,12 +8,12 @@
 
 typedef /*@observer@*/ cstring ob_cstring;
 
-abst_typedef /*@null@*/ struct s_cstringSList
+struct s_cstringSList
 {
   int      nelements;
   int      nspace;
   /*@reldef@*/ /*@relnull@*/ ob_cstring *elements;
-} *cstringSList ;
+} ;
 
 /*@constant null cstringSList cstringSList_undefined;@*/
 # define cstringSList_undefined ((cstringSList) NULL)
@@ -42,7 +42,7 @@ extern void cstringSList_alphabetize (cstringSList p_s);
 extern /*@observer@*/ cstring cstringSList_get (cstringSList p_s, int p_index) /*@*/ ;
 
 extern /*@only@*/ cstring cstringSList_unparseAbbrev (cstringSList p_s) /*@*/ ;
-extern /*@unused@*/ /*@only@*/ cstring cstringSList_unparse (cstringSList p_s) ;
+extern /*@unused@*/ /*@only@*/ cstring cstringSList_unparse (cstringSList p_s) /*@*/ ;
 extern void cstringSList_free (/*@only@*/ cstringSList p_s) ;
 
 extern void cstringSList_printSpaced (cstringSList p_s, size_t p_indent, size_t p_gap, int p_linelen);
index 7c3fecce2007ce2d9545c0f238699885cb6937fb..55823b72e0ed60e975ece66fff55fc4eefc3bc41 100644 (file)
 ** (that is, not void, so any number of arguments is okay.)
 */
 
-abst_typedef /*@null@*/ struct
+struct s_ctypeList
 {
   int nelements;
   int nspace;
   /*@reldef@*/ /*@relnull@*/ ctype  *elements;
-} *ctypeList ;
+} ;
 
 extern int ctypeList_size (/*@sef@*/ ctypeList p_s) /*@*/ ;
 # define ctypeList_size(s)  (ctypeList_isDefined(s) ? (s)->nelements : 0)   
index 0e5b171a62bf6369ab63118139461c0b799057b7..a7c87f53aea6b2a0cecd3d0706f64b339cbc429e 100644 (file)
@@ -13,7 +13,9 @@
 /*@access ctype fileId ctypeList@*/
 /*@+allmacros@*/
 
-abst_typedef /*@null@*/ ctypeList fileIdList;
+/* in forwardTypes:
+   abst_typedef null ctypeList fileIdList;
+*/
 
 extern /*@falsewhennull@*/ bool fileIdList_isDefined (fileIdList p_f);
 # define fileIdList_isDefined(f)  (ctypeList_isDefined (f))
@@ -27,6 +29,9 @@ extern /*@falsewhennull@*/ bool fileIdList_isDefined (fileIdList p_f);
 
 # define end_fileIdList_elements }}
 
+/*@constant null fileIdList fileIdList_undefined; @*/
+# define fileIdList_undefined      ctypeList_undefined
+
 extern fileIdList fileIdList_create (void);
 # define fileIdList_create()       ctypeList_new()
 
index 5f491cea192c124c464690d8e2e18d77ee8ef20f..4cf14a22db57efe4fadd43e183ed3f7482ff46c3 100644 (file)
@@ -105,8 +105,15 @@ extern bool flagcode_isHelpFlag (flagcode p_f) /*@*/ ;
 
 extern void flags_initMod (void) /*@modifies internalState@*/ ;
 
-extern bool flags_processFlags (int p_argc, char **p_argv)
-     /*@requires maxRead(p_argv) >= p_argc - 1@*/
+extern void
+flags_processFlags (bool p_inCommandLine, 
+                   fileIdList p_xfiles,
+                   fileIdList p_cfiles,
+                   fileIdList p_lclfiles,
+                   fileIdList p_mtfiles,
+                   cstringSList *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 */ ;
 
 # else
index 1f6783476d37e4061a0987a09c061a4e32b6c611..73407d6b66b309130635b1e8c73fe862c2afef9b 100644 (file)
@@ -71,12 +71,12 @@ abst_typedef sRefSet globSet;
 abst_typedef /*@null@*/ struct s_constraint *constraint;
 abst_typedef /*@null@*/ struct s_constraintList *constraintList;
 
+abst_typedef /*@null@*/ struct s_ctypeList *ctypeList;
+abst_typedef /*@null@*/ ctypeList fileIdList;
 
 /* DRL modified 9 26 00 */
 
-abst_typedef /*@null@*/ struct s_constraintExpr * constraintExpr;
-
-
+abst_typedef /*@null@*/ struct s_constraintExpr *constraintExpr;
 
 /*@-cppnames@*/
 typedef int bool;
@@ -85,6 +85,10 @@ typedef int bool;
 abst_typedef /*@untainted@*/ /*@null@*/ char *cstring;
 typedef /*@only@*/ cstring o_cstring;
 
+abst_typedef /*@null@*/ struct s_cstringSList *cstringSList;
+
+typedef enum e_LSLInitRuleCode LSLInitRuleCode;
+
 immut_typedef int ctype;
 
 /* sRef -> bool */
diff --git a/src/Headers/help.h b/src/Headers/help.h
new file mode 100644 (file)
index 0000000..afd1139
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
+** See ../LICENSE for license information.
+**
+*/
+/*
+** help.h
+*/
+
+# ifndef HELP_H
+# define HELP_H
+
+extern void help_processFlags (int p_argc, char **p_argv) ;
+extern void help_showAvailableHelp (void) ;
+
+# else
+# error "Multiple include"
+# endif
+
+
+
+
+
index 77c8a6b59329e2311072a6f6aad297fc83a10f3b..6139fb5714db067fc751bd4c1df8ad4457df401d 100644 (file)
@@ -10,9 +10,8 @@
 
 typedef LSLInitRuleCode LCLInitRuleCode;
 
-extern void LCLProcessInitFile(void);
-
-extern void LCLProcessInitFileInit(void);
-extern void LCLProcessInitFileReset(void);
-extern void LCLProcessInitFileCleanup(void);
+extern void lclinit_process (void);
+extern void lclinit_initMod (void);
+extern void lclinit_reset (void);
+extern void lclinit_cleanup (void);
 
index 4e2d0a83b55ac2b6c7a50d6259096530032649b5..f5357e7dccbf9b8eff63c244097681b1de52b76b 100644 (file)
@@ -237,12 +237,14 @@ extern ctype ctype_baseArrayPtr (ctype p_c) /*@*/ ;
 extern ctype ctype_combine (ctype p_dominant, ctype p_modifier) ;
 
 extern ctype ctype_createAbstract (typeId p_u)  /*@*/ ;
-extern ctype 
-  ctype_createEnum (/*@keep@*/ cstring p_tag, /*@keep@*/ enumNameList p_el);
+
 extern ctype ctype_createForwardStruct (/*@only@*/ cstring p_n)  /*@*/ ;
 extern ctype ctype_createForwardUnion (/*@only@*/ cstring p_n)  /*@*/ ;
+extern ctype ctype_createForwardEnum (/*@only@*/ cstring p_n) /*@*/ ;
+
 extern ctype ctype_createStruct (/*@only@*/ cstring p_n, /*@only@*/ uentryList p_f);
 extern ctype ctype_createUnion (/*@only@*/ cstring p_n, /*@only@*/ uentryList p_f);
+extern ctype ctype_createEnum (/*@keep@*/ cstring p_tag, /*@keep@*/ enumNameList p_el);
 
 extern ctype ctype_createUnnamedStruct (/*@only@*/ uentryList p_f) ;
 extern ctype ctype_createUnnamedUnion (/*@only@*/ uentryList p_f) ;
index 89ca3dcc5437ff0aa42f2958a2790b558d84b735..3d7b0fc997a9e3dfc55ab9fc975a2403aa15394c 100644 (file)
@@ -10,21 +10,17 @@ 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; 
-  @*/
+                    undef g_warningstream;@*/
+  /*@modifies g_currentloc, fileSystem, internalState, yyin;@*/
 # else
   /*@globals killed undef g_currentloc,
-            killed       g_localSpecPath,  
             killed undef g_currentSpec,
             killed undef g_currentSpecName,
             killed undef g_currentloc,
             killed undef yyin,
                     undef g_warningstream;
    @*/
-  /*@modifies g_currentloc,
-              g_localSpecPath, g_currentSpec, g_currentSpecName,
+  /*@modifies g_currentloc, g_currentSpec, g_currentSpecName,
              yyin, internalState, fileSystem; 
   @*/ 
 # endif
index bc7d259f76bb8498c8a4944d0b9661c34ca066cd..8895c8c706db2d7a3ff5147afb887684ffb916b1 100644 (file)
 ** lslinit.h
 */
 
-typedef enum {
-                       /* initFile:                                */
-    INITFILE1,         /*    initLines EOF */
-
-
-
-                        /* initLines: */
-    INITLINES1,         /*             */
-    INITLINES2,         /*     initLine  */
-    INITLINES3,         /*     initLines initLine */
-
-                        /* initLine: */
-    INITLINE1,         /*     EOL   */
-    INITLINE2,          /*     classification EOL */
-
-                        /* classification: */
-    CLASSIFICATION1,    /*     charClass */
-    CLASSIFICATION2,    /*     tokenClass */
-    CLASSIFICATION3,    /*     synClass */
-
-                        /* charClass: */
-    CHARCLASS1,         /*     ENDCOMMENTCHAR endCommentChars */
-    CHARCLASS2,         /*     IDCHAR idChars */
-    CHARCLASS3,         /*     OPCHAR opChars */
-    CHARCLASS4,         /*     CHC_EXTENSION extensionChar */
-    CHARCLASS5,         /*     SINGLECHAR singChars */
-    CHARCLASS6,         /*     WHITECHAR whiteChars */
-
-
-                       /* endCommentChars: */
-    LRC_ENDCOMMENT1,   /*     endCommentChar */
-    LRC_ENDCOMMENT2,   /*     endCommentChars endCommentChar */
-
-                       /* idChars: */
-    IDCHARS1,          /*     idChar */
-    IDCHARS2,          /*     idChars idChar */
-
-                       /* opChars */
-    OPCHARS1,          /*    opChar */
-    OPCHARS2,          /*    opChars opChar */
-
-                       /* ExtensionChar */
-    LRC_EXTENSIONCHAR1,        /*     singleChar */
-
-                       /* singChars */
-    SINGCHARS1,                /*     singChar */
-    SINGCHARS2,                /*     singChars singChar */
-
-                       /* whiteChars */
-    WHITECHARS1,       /*     whiteChar */
-    WHITECHARS2,       /*     whiteChars whiteChar */
-
-
-                       /* endCommentChar */
-    LRC_ENDCOMMENTCHAR1,       /*     commentChar */
-    
-                       /* idChar */
-    IDCHAR1,           /*     singleChar */
-    
-                       /* opChar */
-    OPCHAR1,           /*     singleChar */
-    
-                       /* singChar */
-    SINGCHAR1,         /*     singleChar */
-    
-                       /* whiteChar */
-    WHITECHAR1,                /*     singleChar */
-
-                        /* tokenClass: */
-    TOKENCLASS1,        /*     QUANTIFIERSYM quantifierSymToks */
-    TOKENCLASS2,        /*     LOGICALOP logicalOpToks */
-    TOKENCLASS3,        /*     EQOP eqOpToks */
-    TOKENCLASS4,        /*     EQUATIONSYM equationSymToks */
-    TOKENCLASS5,        /*     EQSEPSYM eqSepSymToks */
-    TOKENCLASS6,        /*     SELECTSYM selectSymToks */
-    TOKENCLASS7,        /*     OPENSYM openSymToks */
-    TOKENCLASS8,        /*     SEPSYM sepSymToks */
-    TOKENCLASS9,        /*     CLOSESYM closeSymToks */
-    TOKENCLASS10,       /*     SIMPLEID simpleIdToks */
-    TOKENCLASS11,       /*     MAPSYM mapSymToks */
-    TOKENCLASS12,       /*     MARKERSYM markerSymToks */
-    TOKENCLASS13,       /*     COMMENTSYM commentSymToks */
-
-                       /* quantifierSymToks */
-    QUANTIFIERSYMTOKS1,/*     quantifierSymTok */
-    QUANTIFIERSYMTOKS2,/*     quantifierSymToks quantifierSymTok */
-
-                       /* logicalOpToks */
-    LOGICALOPTOKS1,    /*     logicalOpTok */
-    LOGICALOPTOKS2,    /*     logicalOpToks logicalOpTok */
-
-                       /* eqOpToks */
-    LRC_EQOPTOKS1,             /*     eqOpTok */
-    LRC_EQOPTOKS2,             /*     eqOpToks eqOpTok */
-
-                       /* equationSymToks */
-    LRC_EQUATIONSYMTOKS1, /*     equationSymTok */
-    LRC_EQUATIONSYMTOKS2,      /*     equationSymToks equationSymTok */
-
-                       /* eqSepSymToks */
-    LRC_EQSEPSYMTOKS1, /*     eqSepSymTok */
-    LRC_EQSEPSYMTOKS2, /*     eqSepSymToks eqSepSymTok */
-
-                       /* selectSymToks */
-    SELECTSYMTOKS1,    /*     selectSymTok */
-    SELECTSYMTOKS2,    /*     selectSymToks selectSymTok */
-
-                       /* openSymToks */
-    OPENSYMTOKS1,      /*     openSymTok */
-    OPENSYMTOKS2,      /*     openSymToks openSymTok */
-
-                       /* sepSymToks */
-    SEPSYMTOKS1,       /*     sepSymTok */
-    SEPSYMTOKS2,       /*     sepSymToks sepSymTok */
-
-                       /* closeSymToks */
-    CLOSESYMTOKS1,     /*     closeSymTok */
-    CLOSESYMTOKS2,     /*     closeSymToks closeSymTok */
-
-                       /* simpleIdToks */
-    SIMPLEIDTOKS1,     /*     simpleIdTok */
-    SIMPLEIDTOKS2,     /*     simpleIdToks simpleIdTok */
-
-                       /* mapSymToks */
-    MAPSYMTOKS1,               /*     mapSymTok */
-    MAPSYMTOKS2,               /*     mapSymToks mapSymTok */
-
-                       /* markerSymToks */
-    MARKERSYMTOKS1,    /*     markerSymTok */
-    MARKERSYMTOKS2,    /*     markerSymToks markerSymTok */
-
-                       /* commentSymToks */
-    COMMENTSYMTOKS1,   /*     commentSymTok */
-    COMMENTSYMTOKS2,   /*     commentSymToks commentSymTok */
-
-                       /* quantifierSymTok */
-    QUANTIFIERSYMTOK1, /*     token */
-
-                       /* logicalOpTok */
-    LOGICALOPTOK1,     /*     token */
-
-                       /* eqOpTok */
-    LRC_EQOPTOK1,              /*     token */
-
-                       /* equationSymTok */
-    LRC_EQUATIONSYMTOK1,       /*     token */
-
-                       /* eqSepSymTok */
-    LRC_EQSEPSYMTOK1,  /*     token */
-
-                       /* selectSymTok */
-    SELECTSYMTOK1,     /*     token */
-
-                       /* openSymTok */
-    OPENSYMTOK1,       /*     token */
-
-                       /* sepSymTok */
-    SEPSYMTOK1,                /*     token */
-
-                       /* closeSymTok */
-    CLOSESYMTOK1,      /*     token */
-
-                       /* simpleIdTok */
-    SIMPLEIDTOK1,      /*     token */
-
-                       /* mapSymTok */
-    MAPSYMTOK1,                /*     token */
-
-                       /* markerSymTok */
-    MARKERSYMTOK1,     /*     token */
-
-                       /* commentSymTok */
-    COMMENTSYMTOK1,    /*     token */
-
-                        /* synClass: */
-    SYNCLASS1,          /*     SYNONYM oldToken newToken */
-
-                        /* oldToken: */
-    OLDTOKEN1,          /*     token */
-
-                        /* newToken: */
-    NEWTOKEN1           /*     token */
-
-} LSLInitRuleCode;
-
-extern void LSLProcessInitFile (void);
-extern void LSLProcessInitFileInit (void);
-
+enum e_LSLInitRuleCode {
+  /* initFile:                             */
+  INITFILE1,           /*    initLines EOF */
+  /* initLines: */
+  INITLINES1,         /*               */
+  INITLINES2,         /*     initLine  */
+  INITLINES3,         /*     initLines initLine */
+  
+  /* initLine: */
+  INITLINE1,           /*     EOL   */
+  INITLINE2,          /*     classification EOL */
+  
+  /* classification: */
+  CLASSIFICATION1,    /*     charClass */
+  CLASSIFICATION2,    /*     tokenClass */
+  CLASSIFICATION3,    /*     synClass */
+  
+  /* charClass: */
+  CHARCLASS1,         /*     ENDCOMMENTCHAR endCommentChars */
+  CHARCLASS2,         /*     IDCHAR idChars */
+  CHARCLASS3,         /*     OPCHAR opChars */
+  CHARCLASS4,         /*     CHC_EXTENSION extensionChar */
+  CHARCLASS5,         /*     SINGLECHAR singChars */
+  CHARCLASS6,         /*     WHITECHAR whiteChars */
+
+  /* endCommentChars: */
+  LRC_ENDCOMMENT1,     /*     endCommentChar */
+  LRC_ENDCOMMENT2,     /*     endCommentChars endCommentChar */
+  
+  /* idChars: */
+  IDCHARS1,            /*     idChar */
+  IDCHARS2,            /*     idChars idChar */
+  
+  /* opChars */
+  OPCHARS1,            /*    opChar */
+  OPCHARS2,            /*    opChars opChar */
+  
+  /* ExtensionChar */
+  LRC_EXTENSIONCHAR1,  /*     singleChar */
+  
+  /* singChars */
+  SINGCHARS1,          /*     singChar */
+  SINGCHARS2,          /*     singChars singChar */
+  
+  /* whiteChars */
+  WHITECHARS1, /*     whiteChar */
+  WHITECHARS2, /*     whiteChars whiteChar */
+  
+  /* endCommentChar */
+  LRC_ENDCOMMENTCHAR1, /*     commentChar */
+  
+  /* idChar */
+  IDCHAR1,             /*     singleChar */
+  
+  /* opChar */
+  OPCHAR1,             /*     singleChar */
+  
+  /* singChar */
+  SINGCHAR1,           /*     singleChar */
+  
+  /* whiteChar */
+  WHITECHAR1,          /*     singleChar */
+  
+  /* tokenClass: */
+  TOKENCLASS1,        /*     QUANTIFIERSYM quantifierSymToks */
+  TOKENCLASS2,        /*     LOGICALOP logicalOpToks */
+  TOKENCLASS3,        /*     EQOP eqOpToks */
+  TOKENCLASS4,        /*     EQUATIONSYM equationSymToks */
+  TOKENCLASS5,        /*     EQSEPSYM eqSepSymToks */
+  TOKENCLASS6,        /*     SELECTSYM selectSymToks */
+  TOKENCLASS7,        /*     OPENSYM openSymToks */
+  TOKENCLASS8,        /*     SEPSYM sepSymToks */
+  TOKENCLASS9,        /*     CLOSESYM closeSymToks */
+  TOKENCLASS10,       /*     SIMPLEID simpleIdToks */
+  TOKENCLASS11,       /*     MAPSYM mapSymToks */
+  TOKENCLASS12,       /*     MARKERSYM markerSymToks */
+  TOKENCLASS13,       /*     COMMENTSYM commentSymToks */
+  
+  /* quantifierSymToks */
+  QUANTIFIERSYMTOKS1,/*     quantifierSymTok */
+  QUANTIFIERSYMTOKS2,/*     quantifierSymToks quantifierSymTok */
+  
+  /* logicalOpToks */
+  LOGICALOPTOKS1,      /*     logicalOpTok */
+  LOGICALOPTOKS2,      /*     logicalOpToks logicalOpTok */
+  
+  /* eqOpToks */
+  LRC_EQOPTOKS1,               /*     eqOpTok */
+  LRC_EQOPTOKS2,               /*     eqOpToks eqOpTok */
+  
+  /* equationSymToks */
+  LRC_EQUATIONSYMTOKS1, /*     equationSymTok */
+  LRC_EQUATIONSYMTOKS2,        /*     equationSymToks equationSymTok */
+  
+  /* eqSepSymToks */
+  LRC_EQSEPSYMTOKS1,   /*     eqSepSymTok */
+  LRC_EQSEPSYMTOKS2,   /*     eqSepSymToks eqSepSymTok */
+  
+  /* selectSymToks */
+  SELECTSYMTOKS1,      /*     selectSymTok */
+  SELECTSYMTOKS2,      /*     selectSymToks selectSymTok */
+  
+  /* openSymToks */
+  OPENSYMTOKS1,        /*     openSymTok */
+  OPENSYMTOKS2,        /*     openSymToks openSymTok */
+  
+  /* sepSymToks */
+  SEPSYMTOKS1, /*     sepSymTok */
+  SEPSYMTOKS2, /*     sepSymToks sepSymTok */
+  
+  /* closeSymToks */
+  CLOSESYMTOKS1,       /*     closeSymTok */
+  CLOSESYMTOKS2,       /*     closeSymToks closeSymTok */
+  
+  /* simpleIdToks */
+  SIMPLEIDTOKS1,       /*     simpleIdTok */
+  SIMPLEIDTOKS2,       /*     simpleIdToks simpleIdTok */
+  
+  /* mapSymToks */
+  MAPSYMTOKS1,         /*     mapSymTok */
+  MAPSYMTOKS2,         /*     mapSymToks mapSymTok */
+  
+  /* markerSymToks */
+  MARKERSYMTOKS1,      /*     markerSymTok */
+  MARKERSYMTOKS2,      /*     markerSymToks markerSymTok */
+  
+  /* commentSymToks */
+  COMMENTSYMTOKS1,     /*     commentSymTok */
+  COMMENTSYMTOKS2,     /*     commentSymToks commentSymTok */
+  
+  /* quantifierSymTok */
+  QUANTIFIERSYMTOK1,   /*     token */
+  
+  /* logicalOpTok */
+  LOGICALOPTOK1,       /*     token */
+  
+  /* eqOpTok */
+  LRC_EQOPTOK1,                /*     token */
+  
+  /* equationSymTok */
+  LRC_EQUATIONSYMTOK1, /*     token */
+  
+  /* eqSepSymTok */
+  LRC_EQSEPSYMTOK1,    /*     token */
+  
+  /* selectSymTok */
+  SELECTSYMTOK1,       /*     token */
+  
+  /* openSymTok */
+  OPENSYMTOK1, /*     token */
+  
+  /* sepSymTok */
+  SEPSYMTOK1,          /*     token */
+  
+  /* closeSymTok */
+  CLOSESYMTOK1,        /*     token */
+  
+  /* simpleIdTok */
+  SIMPLEIDTOK1,        /*     token */
+  
+  /* mapSymTok */
+  MAPSYMTOK1,          /*     token */
+  
+  /* markerSymTok */
+  MARKERSYMTOK1,       /*     token */
+  
+  /* commentSymTok */
+  COMMENTSYMTOK1,      /*     token */
+  
+  /* synClass: */
+  SYNCLASS1,          /*     SYNONYM oldToken newToken */
+  
+  /* oldToken: */
+  OLDTOKEN1,          /*     token */
+  
+  /* newToken: */
+  NEWTOKEN1           /*     token */
+} ;
+
+extern void lslinit_setInitFile (/*@only@*/ inputStream p_s)
+     /*@modifies internalState@*/ ;
+
+extern void lslinit_process (void)     
+     /*@globals undef g_symtab; @*/
+     /*@modifies g_symtab, internalState, fileSystem; @*/ ;
index fe797ce3fc799326ed10ccc702f80598525c7cc6..f4f8f64d362feb97d21164212a030d96c6ebcd4f 100644 (file)
@@ -53,7 +53,8 @@
 typedef enum {
   OSD_FILEFOUND,
   OSD_FILENOTFOUND,
-  OSD_PATHTOOLONG } filestatus;
+  OSD_PATHTOOLONG 
+} filestatus;
 
 extern /*@only@*/ cstring LSLRootName (cstring p_filespec) /*@*/ ;
 
diff --git a/src/Headers/rcfiles.h b/src/Headers/rcfiles.h
new file mode 100644 (file)
index 0000000..fa0e0aa
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
+** See ../LICENSE for license information.
+**
+*/
+/*
+** rcfiles.h
+*/
+
+# ifndef RCFILES_H
+# define RCFILES_H
+
+extern bool rcfiles_read (cstring p_fname,
+                         cstringSList *p_passThroughArgs,
+                         bool p_report) 
+  /*@modifies fileSystem, internalState, *p_passThroughArgs@*/ ;
+   
+# endif
index 55b85392081b37432c8f3bdcec75592da047b1c3..b53ddab0a77fcac82e04e1c4ea14c07a8ad03fdf 100644 (file)
@@ -42,7 +42,7 @@ CSRC = context.c uentry.c cprim.c macrocache.c qual.c qtype.c stateClause.c \
        functionClauseList.c metaStateConstraint.c metaStateConstraintList.c \
        metaStateExpression.c metaStateSpecifier.c functionConstraint.c
 
-SPLINTSRC = exprNode.c exprChecks.c llmain.c
+SPLINTSRC = exprNode.c exprChecks.c llmain.c help.c rcfiles.c
 CHECKSRC = structNames.c transferChecks.c varKinds.c nameChecks.c
 
 GLOBSRC = globals.c flags.c general.c osd.c reader.c mtreader.c
@@ -152,7 +152,7 @@ HEADERSRC = Headers/abstBodyNode.h           Headers/ltokenList.h \
           Headers/exprNode.h               Headers/quantifierNode.h \
           Headers/exprNodeList.h           Headers/quantifierNodeList.h \
           Headers/exprNodeSList.h          Headers/randomNumbers.h \
-          Headers/fcnNode.h                \
+          Headers/fcnNode.h                Headers/rcfiles.h \
           Headers/fcnNodeList.h            Headers/reader.h \
           Headers/fileId.h                 Headers/refTable-branch.h \
           Headers/fileIdList.h             Headers/renamingNode.h \
@@ -374,7 +374,7 @@ etags:
 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
+       ./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
index 9c9affc3311e937bf19a4b3635b4adb372c6a324..799ecbd35674a2fbe4aa9da75d73bf714485f898 100644 (file)
@@ -124,7 +124,7 @@ CSRC = context.c uentry.c cprim.c macrocache.c qual.c qtype.c stateClause.c \
        metaStateExpression.c metaStateSpecifier.c functionConstraint.c
 
 
-SPLINTSRC = exprNode.c exprChecks.c llmain.c
+SPLINTSRC = exprNode.c exprChecks.c llmain.c help.c rcfiles.c
 CHECKSRC = structNames.c transferChecks.c varKinds.c nameChecks.c
 
 GLOBSRC = globals.c flags.c general.c osd.c reader.c mtreader.c
@@ -238,7 +238,7 @@ HEADERSRC = Headers/abstBodyNode.h           Headers/ltokenList.h \
           Headers/exprNode.h               Headers/quantifierNode.h \
           Headers/exprNodeList.h           Headers/quantifierNodeList.h \
           Headers/exprNodeSList.h          Headers/randomNumbers.h \
-          Headers/fcnNode.h                \
+          Headers/fcnNode.h                Headers/rcfiles.h \
           Headers/fcnNodeList.h            Headers/reader.h \
           Headers/fileId.h                 Headers/refTable-branch.h \
           Headers/fileIdList.h             Headers/renamingNode.h \
@@ -444,11 +444,11 @@ am_splint_OBJECTS = cgrammar.$(OBJEXT) cscanner.$(OBJEXT) \
        mtDefaultsDecl.$(OBJEXT) mtMergeItem.$(OBJEXT) \
        mtMergeClause.$(OBJEXT) mtMergeClauseList.$(OBJEXT) \
        exprNode.$(OBJEXT) exprChecks.$(OBJEXT) llmain.$(OBJEXT) \
-       constraintGeneration.$(OBJEXT) constraintTerm.$(OBJEXT) \
-       constraintExprData.$(OBJEXT) constraintExpr.$(OBJEXT) \
-       constraint.$(OBJEXT) constraintList.$(OBJEXT) \
-       constraintResolve.$(OBJEXT) constraintOutput.$(OBJEXT) \
-       loopHeuristics.$(OBJEXT)
+       help.$(OBJEXT) rcfiles.$(OBJEXT) constraintGeneration.$(OBJEXT) \
+       constraintTerm.$(OBJEXT) constraintExprData.$(OBJEXT) \
+       constraintExpr.$(OBJEXT) constraint.$(OBJEXT) \
+       constraintList.$(OBJEXT) constraintResolve.$(OBJEXT) \
+       constraintOutput.$(OBJEXT) loopHeuristics.$(OBJEXT)
 splint_OBJECTS = $(am_splint_OBJECTS)
 splint_LDFLAGS =
 
@@ -495,9 +495,9 @@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 @AMDEP_TRUE@   $(DEPDIR)/general.Po $(DEPDIR)/genericTable.Po \
 @AMDEP_TRUE@   $(DEPDIR)/globSet.Po $(DEPDIR)/globals.Po \
 @AMDEP_TRUE@   $(DEPDIR)/globalsClause.Po $(DEPDIR)/guardSet.Po \
-@AMDEP_TRUE@   $(DEPDIR)/idDecl.Po $(DEPDIR)/idDeclList.Po \
-@AMDEP_TRUE@   $(DEPDIR)/importNodeList.Po $(DEPDIR)/imports.Po \
-@AMDEP_TRUE@   $(DEPDIR)/initDeclNodeList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/help.Po $(DEPDIR)/idDecl.Po \
+@AMDEP_TRUE@   $(DEPDIR)/idDeclList.Po $(DEPDIR)/importNodeList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/imports.Po $(DEPDIR)/initDeclNodeList.Po \
 @AMDEP_TRUE@   $(DEPDIR)/inputStream.Po $(DEPDIR)/intSet.Po \
 @AMDEP_TRUE@   $(DEPDIR)/interfaceNodeList.Po \
 @AMDEP_TRUE@   $(DEPDIR)/lclctypes.Po $(DEPDIR)/lclinit.Po \
@@ -548,15 +548,15 @@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 @AMDEP_TRUE@   $(DEPDIR)/programNodeList.Po $(DEPDIR)/qtype.Po \
 @AMDEP_TRUE@   $(DEPDIR)/qual.Po $(DEPDIR)/qualList.Po \
 @AMDEP_TRUE@   $(DEPDIR)/quantifierNodeList.Po \
-@AMDEP_TRUE@   $(DEPDIR)/randomNumbers.Po $(DEPDIR)/reader.Po \
-@AMDEP_TRUE@   $(DEPDIR)/replaceNodeList.Po $(DEPDIR)/sRef.Po \
-@AMDEP_TRUE@   $(DEPDIR)/sRefList.Po $(DEPDIR)/sRefSet.Po \
-@AMDEP_TRUE@   $(DEPDIR)/sRefSetList.Po $(DEPDIR)/sRefTable.Po \
-@AMDEP_TRUE@   $(DEPDIR)/scan.Po $(DEPDIR)/scanline.Po \
-@AMDEP_TRUE@   $(DEPDIR)/shift.Po $(DEPDIR)/sigNodeSet.Po \
-@AMDEP_TRUE@   $(DEPDIR)/signature.Po $(DEPDIR)/sort.Po \
-@AMDEP_TRUE@   $(DEPDIR)/sortList.Po $(DEPDIR)/sortSet.Po \
-@AMDEP_TRUE@   $(DEPDIR)/sortSetList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/randomNumbers.Po $(DEPDIR)/rcfiles.Po \
+@AMDEP_TRUE@   $(DEPDIR)/reader.Po $(DEPDIR)/replaceNodeList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/sRef.Po $(DEPDIR)/sRefList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/sRefSet.Po $(DEPDIR)/sRefSetList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/sRefTable.Po $(DEPDIR)/scan.Po \
+@AMDEP_TRUE@   $(DEPDIR)/scanline.Po $(DEPDIR)/shift.Po \
+@AMDEP_TRUE@   $(DEPDIR)/sigNodeSet.Po $(DEPDIR)/signature.Po \
+@AMDEP_TRUE@   $(DEPDIR)/sort.Po $(DEPDIR)/sortList.Po \
+@AMDEP_TRUE@   $(DEPDIR)/sortSet.Po $(DEPDIR)/sortSetList.Po \
 @AMDEP_TRUE@   $(DEPDIR)/stDeclNodeList.Po \
 @AMDEP_TRUE@   $(DEPDIR)/stateClause.Po \
 @AMDEP_TRUE@   $(DEPDIR)/stateClauseList.Po \
@@ -691,6 +691,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/globals.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/globalsClause.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/guardSet.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/help.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/idDecl.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/idDeclList.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/importNodeList.Po@am__quote@
@@ -768,6 +769,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/qualList.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quantifierNodeList.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/randomNumbers.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/rcfiles.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/reader.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/replaceNodeList.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/sRef.Po@am__quote@
@@ -1051,7 +1053,7 @@ etags:
 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
+       ./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
index db7300c787f9bd215e9e1405bf413dc27507a514..5628c1577d427a0d49053274be0d42f8fd6dae57 100644 (file)
@@ -1810,7 +1810,7 @@ handleEnum (cstring id)
     }
   else
     {
-      return (declareEnum (id, enumNameList_new ()));
+      return (ctype_createForwardEnum (id));
     }
 }
 
index 5a435305ad9dd1cecea3c1377e42d1595399617d..ba5b7adaa4c967bd6d2e6c6bd2db786d2d05fa38 100644 (file)
@@ -42,7 +42,6 @@
 
 # include "exprChecks.h"
 # include "filelocStack.h"
-# include "fileIdList.h"
 # include "llmain.h"
 # include "intSet.h"
 # include "osd.h"
@@ -3024,13 +3023,13 @@ context_setString (flagcode flag, cstring val)
       {
        ; /* Okay not handle everything in this switch */
       }
-    } /* evans 2002-03-24: splintme reports a spurious (I think) warning here...need to look into it */
+  /*@i523@*/ } /* evans 2002-03-24: splintme reports a spurious (I think) warning here...need to look into it */
   
   if (cstring_length (val) >= 1
       && cstring_firstChar (val) == '\"')
     {
       llerror_flagWarning (message
-                          ("setting %s to string beginning with \".  You probably "
+                          ("Setting %s to string beginning with \".  You probably "
                            "don't meant to have the \"'s.",
                            flagcode_unparse (flag)));
     }
@@ -3705,7 +3704,9 @@ context_inFunctionName (void)
 void
 context_userSetFlag (flagcode f, bool b)
 {
-  DPRINTF (("set flag: %s", flagcode_unparse (f)));
+  DPRINTF (("set flag: %s / %s", 
+           flagcode_unparse (f),
+           bool_unparse (context_getFlag (f))));
 
   if (f == FLG_NEVERINCLUDE && b)
     {
@@ -3713,7 +3714,7 @@ context_userSetFlag (flagcode f, bool b)
        {
          llerror_flagWarning 
            (cstring_makeLiteral
-            ("setting +neverinclude after +exportheader.  "
+            ("Setting +neverinclude after +exportheader.  "
              "Turning off exportheader, since headers are not checked "
              "when +neverinclude is used."));
 
@@ -3728,7 +3729,7 @@ context_userSetFlag (flagcode f, bool b)
            {
              llerror_flagWarning
                (cstring_makeLiteral
-                ("setting +exportheader after +neverinclude.  "
+                ("Setting +exportheader after +neverinclude.  "
                  "Not setting exportheader, since headers are not checked "
                  "when +neverinclude is used."));
              gc.flags[FLG_EXPORTHEADER] = FALSE;
@@ -3747,7 +3748,7 @@ context_userSetFlag (flagcode f, bool b)
          && !flagcode_hasArgument (f))
        {
          llerror_flagWarning 
-           (message ("setting %s%s redundant with current value", 
+           (message ("Setting %s%s redundant with current value", 
                      cstring_makeLiteralTemp (b ? "+" : "-"),
                      flagcode_unparse (f)));
        }
@@ -3758,7 +3759,7 @@ context_userSetFlag (flagcode f, bool b)
       if (!context_getFlag (FLG_WARNUSE))
        {
          llerror_flagWarning
-           (message ("flag +%s is canceled by -warnuse",
+           (message ("Flag +%s is canceled by -warnuse",
                      flagcode_unparse (f)));
        }
     }
@@ -3770,7 +3771,7 @@ context_userSetFlag (flagcode f, bool b)
          && gc.library != f)
        {
          llerror_flagWarning 
-           (message ("selecting library %s after library %s was "
+           (message ("Selecting library %s after library %s was "
                      "selected (only one library may be used)",
                      flagcode_unparse (f),
                      flagcode_unparse (gc.library)));
@@ -3782,7 +3783,7 @@ context_userSetFlag (flagcode f, bool b)
            {
              llerror_flagWarning
                (cstring_makeLiteral
-                ("selecting unix library.  Unix library is "
+                ("Selecting unix library.  Unix library is "
                  "ad hoc addition to POSIX library.  Recommend "
                  "use +posixlib to select POSIX library instead. "
                  "Use -warnunixlib to suppress this message."));
@@ -3796,7 +3797,7 @@ context_userSetFlag (flagcode f, bool b)
     {
       llerror_flagWarning
        (message
-        ("setting +%s will not produce warnings with -namechecks. "
+        ("Setting +%s will not produce warnings with -namechecks. "
          "Must set +namechecks also.",
          flagcode_unparse (f)));
     }
index 58dc81d139c79dce01cf017968863d6f34fa438a..243e875dc338fe71927f87d080eb03e76a8fd9d3 100644 (file)
@@ -1169,8 +1169,18 @@ copy_rest_of_line (cppReader *pfile)
        case EOF:
          goto end_directive;
        case '\\':
-         if (cppReader_peekC (pfile) == '\n')
+         /*
+         ** Patch from Brian St. Pierre for handling MS-DOS files.
+         */
+
+         if (cppReader_peekC (pfile) == '\n'
+             || cppReader_peekC (pfile) == '\r')
            {
+             if (cppReader_peekC (pfile) == '\r')
+               {
+                 cppReader_forward (pfile, 1);
+               }
+             
              cppReader_forward (pfile, 1);
              continue;
            }
index 9c568d918708967a25f07ca1ad5c208b5b1ade76..b05ddc437687db37f11978ffa34667d1ef4eea19 100644 (file)
@@ -174,6 +174,8 @@ void cppAddIncludeDir (cstring dir)
   ** Add the -I- code.  This code provided by Robin Watts <Robin.Watts@wss.co.uk>
   */
 
+  DPRINTF (("Adding include: %s", dir));
+
   if (cstring_equalLit (dir, "-I-"))
     {
       struct cppOptions *opts = CPPOPTIONS (&g_cppState);    
@@ -184,8 +186,11 @@ void cppAddIncludeDir (cstring dir)
       /* -I option (Add directory to include path) */
       struct file_name_list *dirtmp = (struct file_name_list *) dmalloc (sizeof (*dirtmp));
       
+      llassert (cstring_firstChar (dir) == 'I');
+      dir = cstring_suffix (dir, 1);
+
       DPRINTF (("Add include: %s", dir));
-      
+
       dirtmp->next = 0;                /* New one goes on the end */
       dirtmp->control_macro = 0;
       dirtmp->c_system_include_path = FALSE;
index 0d05b48b4c8c456b1ca66b678f49976b0f2d6635..b1e7d78a136d26faf26d5174c3fcf47fe39b898d 100644 (file)
@@ -84,8 +84,6 @@ ULSuffix                ({U}{L}|{L}{U})
 
 # include "cgrammar.h"
 # include "cgrammar_tokens.h"
-
-# include "fileIdList.h"
 # include "portab.h"
 
 static bool lastWasString = FALSE;
@@ -2049,33 +2047,30 @@ static int handleLlSpecial ()
                {
                  ;
                }
-             else if (flagcode_isInvalid (fflag))
+             else if (flagcode_isModeName (fflag))
                {
-                 if (isMode (flagname))
+                 if (ynm_isMaybe (set))
                    {
-                     if (ynm_isMaybe (set))
-                       {
-                         llerror
-                           (FLG_BADFLAG, 
-                            message 
-                            ("Semantic comment attempts to restore flag %s.  "
-                             "A mode flag cannot be restored.",
-                             flagname));
-                       }
-                     else
-                       {
-                         context_setMode (flagname);
-                       }
+                     llerror
+                       (FLG_BADFLAG, 
+                        message 
+                        ("Semantic comment attempts to restore flag %s.  "
+                         "A mode flag cannot be restored.",
+                         flagname));
                    }
                  else
                    {
-                     voptgenerror
-                       (FLG_UNRECOGFLAGCOMMENTS,
-                        message ("Unrecognized option in semantic comment: %s", 
-                                 flagname),
-                        loc);
+                     context_setMode (flagname);
                    }
                }
+             else if (flagcode_isInvalid (fflag))
+               {
+                 voptgenerror
+                   (FLG_UNRECOGFLAGCOMMENTS,
+                    message ("Unrecognized option in semantic comment: %s", 
+                             flagname),
+                    loc);
+               }
              else if (flagcode_isGlobalFlag (fflag))
                {
                  voptgenerror
index 145c8d2339120738d549097c6868e1c86388ff1f..479b4be394a75d95086290de5e62eebe45bc9621 100644 (file)
@@ -339,3 +339,16 @@ cstringList_get (cstringList s, int index)
   llassertretnull (index < s->nelements);
   return s->elements[index];
 }
+
+ob_mstring *
+cstringList_getElements (cstringList s)
+{
+  if (cstringList_isDefined (s))
+    {
+      /*@i423@*/ return s->elements;
+    }
+  else
+    {
+      return NULL;
+    }
+}
index 29c0a6bf9533cf1b21828cc210903127aca6ff67..d246bf763fa419ea8f064924986492f371f74466 100644 (file)
@@ -2212,6 +2212,16 @@ ctype_createForwardUnion (cstring n)
   return (ct);
 }
 
+ctype
+ctype_createForwardEnum (cstring n)
+{
+  uentry ue  = uentry_makeEnumTag (n, ctype_unknown, fileloc_undefined);
+  ctype ct = usymtab_supForwardTypeEntry (ue);
+
+  cstring_free (n);
+  return (ct);
+}
+
 ctype
 ctype_removePointers (ctype c)
 {
index cbff8d42fdb55ef5191e55751aba5d6148ec566a..18b747256036bb1a71cc9244d6e683e9b0235eb0 100644 (file)
@@ -27,4 +27,7 @@
 
 # include "splintMacros.nf"
 # include "basic.h"
-# include "fileIdList.h"
+
+/*
+** No code needed (all from ctypeList)
+*/
index 2d6b9a7c21cf640baa23802311ec77b661f821e8..03a6be1e7a96d842bb8fe0bcb6c606be6af836df 100644 (file)
@@ -324,7 +324,7 @@ fileTable_addFilePrim (fileTable ft, /*@temp@*/ cstring name,
   cstring absname = osd_absolutePath (NULL, name);
   int tindex = fileTable_getIndex (ft, absname);
   
-  DPRINTF (("Got abs path: %s", absname));
+  /*@i534 fprintf (stderr, "Got abs path: %s", absname); */
   llassert (ft != fileTable_undefined);
 
   if (tindex != NOT_FOUND)
@@ -809,7 +809,7 @@ fileTable_cleanup (fileTable ft)
   if (msg)
     {
       (void) fflush (g_warningstream);
-      fprintf (stderr, "< cleaning");
+      displayScanOpen (cstring_makeLiteral ("< cleaning"));
     }
 
   for (i = 0; i < ft->nentries; i++)
@@ -851,21 +851,13 @@ fileTable_cleanup (fileTable ft)
 
       if (msg && ((i % skip) == 0))
        {
-         (void) fflush (g_warningstream);
-
-         if (i == 0) {
-           fprintf (stderr, " ");
-         } else {
-           fprintf (stderr, ".");
-         }
-
-         (void) fflush (stderr);
+         displayScan (cstring_makeLiteral (i == 0 ? " " : "."));
        }
     }
-  
+
   if (msg)
     {
-      fprintf (stderr, " >\n");
+      displayScanClose ();
     }
 }
 
index 729c633debbf41413e101988bca191d1ab16724b..bce4b0cb2120e45d296b9d96578bab0b590504fa 100644 (file)
@@ -35,7 +35,6 @@
 
 # include "splintMacros.nf"
 # include "llbasic.h"
-# include "fileIdList.h"
 # include "osd.h"
 # include "portab.h"
 
@@ -600,7 +599,14 @@ fileloc_filename (fileloc f)
 {
   if (fileloc_isDefined (f))
     {
-      return osd_outputPath (fileTable_rootFileName (f->fid));
+      if (fileId_isValid (f->fid))
+       {
+         return osd_outputPath (fileTable_rootFileName (f->fid));
+       }
+      else
+       {
+         return cstring_makeLiteral ("<invalid>");
+       }
     }
   else
     {
@@ -645,16 +651,24 @@ fileloc_column (fileloc f)
 /*@only@*/ cstring
 fileloc_unparse (fileloc f)
 {
+  static in_funparse = FALSE;
   bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
   bool htmlFormat = context_getFlag (FLG_HTMLFILEFORMAT);
   cstring res = cstring_undefined;
 
+  /* watch out for recursive calls when debugging... */
+  llassert (!in_funparse);
+  in_funparse = TRUE;
+
   if (fileloc_isDefined (f))
     {
        switch (f->kind)
        {
        case FL_BUILTIN:
-         return (cstring_makeLiteral ("Command Line"));
+         {
+           res = cstring_makeLiteral ("Command Line");
+           break;
+         }
        case FL_IMPORT:
          if (parenFormat)
            {
@@ -753,7 +767,8 @@ fileloc_unparse (fileloc f)
     {
       res = cstring_makeLiteral ("< Location unknown >");
     }
-  
+
+  in_funparse = FALSE;
   return res;
 }
 
index a56ab38036d3aa990d4a62589ee0f539b075ac15..27e018e523f4f99c7f8a3cd851f2cf6b42712a8f 100644 (file)
 
 # include "splintMacros.nf"
 # include "basic.h"
+# include "osd.h"
 # include "portab.h"
+# include "rcfiles.h"
+# include "lslinit.h"
 
 /*
 ** from the CC man page:
@@ -1241,6 +1244,7 @@ flags_identifyFlagAux (cstring s, bool quiet)
       else if (flags_isModeName (cflag))
        {
          res = MODENAME_FLAG;
+       }
       else
        {
          res = INVALID_FLAG;
@@ -1548,15 +1552,111 @@ bool flagcode_isNamePrefixFlag (flagcode f)
       return FALSE;
     }
 }
-       
-bool flags_processFlags (bool inCommandLine, int argc, char **argv)
+
+static cstring findLarchPathFile (/*@temp@*/ cstring s)
 {
-  int i;
+  cstring pathName;
+  filestatus status;
+  
+  status = osd_getPath (context_getLarchPath (), s, &pathName);
+  
+  if (status == OSD_FILEFOUND)
+    {
+      return pathName;
+    }
+  else if (status == OSD_FILENOTFOUND)
+    {
+      showHerald ();
+      lldiagmsg        (message ("Cannot find file on LARCH_PATH: %s", s));
+    }
+  else if (status == OSD_PATHTOOLONG)
+    {
+      /* Directory and filename are too long.  Report error. */
+      llbuglit ("soure_getPath: Filename plus directory from search path too long");
+    }
+  else
+    {
+      BADBRANCH;
+    }
+
+  return cstring_undefined;
+}
+
+static void addLarchPathFile (fileIdList files, /*@temp@*/ cstring s)
+{
+  cstring pathName = findLarchPathFile (s);
+
+  if (cstring_isDefined (pathName))
+    {
+      if (fileTable_exists (context_fileTable (), pathName))
+       {
+         showHerald ();
+         lldiagmsg (message ("File listed multiple times: %s", pathName));
+         cstring_free (pathName);
+       }
+      else
+       {
+         fileIdList_add (files, fileTable_addFileOnly (context_fileTable (), pathName));
+       }
+    }
+}
+
+
+static void addFile (fileIdList files, /*@only@*/ cstring s)
+{
+  if (fileTable_exists (context_fileTable (), s))
+    {
+      showHerald ();
+      lldiagmsg (message ("File listed multiple times: %s", s));
+      cstring_free (s);
+    }
+  else
+    {
+      fileIdList_add (files, fileTable_addFileOnly (context_fileTable (), s));
+    }
+}
+
+static void addXHFile (fileIdList files, /*@temp@*/ cstring s)
+{
+  cstring pathName = findLarchPathFile (s);
+
+  if (cstring_isDefined (pathName))
+    {
+      if (fileTable_exists (context_fileTable (), pathName))
+       {
+         showHerald ();
+         lldiagmsg (message ("File listed multiple times: %s", s));
+       }
+      else
+       {
+         fileIdList_add (files, fileTable_addXHFile (context_fileTable (), pathName));
+       }
+    }
 
+  cstring_free (pathName);
+}
+
+void
+flags_processFlags (bool inCommandLine, 
+                   fileIdList xfiles,
+                   fileIdList cfiles,
+                   fileIdList lclfiles,
+                   fileIdList mtfiles,
+                   cstringSList *passThroughArgs,
+                   int argc, char **argv)
+{
+  int i;
+  cstringSList fl = cstringSList_undefined;
+    
   for (i = 0; i < argc; i++)
     {
-      char *thisarg = argv[i];
-      
+      char *thisarg;
+
+      llassert (argv != NULL);
+      thisarg = argv[i];
+
+      DPRINTF (("thisarg: %s", thisarg));
+
       if (*thisarg == '-' || *thisarg == '+')
        {
          bool set = (*thisarg == '+');
@@ -1590,7 +1690,39 @@ bool flags_processFlags (bool inCommandLine, int argc, char **argv)
                                g_currentloc);
                }
            }
-         else if (flagcode_isModeNameFlag (opt))
+         else if (flagcode_isPassThrough (opt)) /* preprocessor flag: -D or -U */
+           { 
+             /*
+             ** Following space is optional, don't include the -
+             */
+             
+             *passThroughArgs = cstringSList_add (*passThroughArgs, 
+                                                  cstring_fromChars (thisarg + 1));
+           }
+         else if (opt == FLG_INCLUDEPATH || opt == FLG_SPECPATH)
+           {
+             cstring dir = cstring_suffix (cstring_fromChars (thisarg), 1); /* skip over I */
+             
+             DPRINTF (("Directory: %s", dir));
+             
+             switch (opt)
+               {
+               case FLG_INCLUDEPATH:
+                 cppAddIncludeDir (dir);
+                 /*@switchbreak@*/ break;
+               case FLG_SPECPATH:
+                 /*@-mustfree@*/
+                 g_localSpecPath = cstring_toCharsSafe
+                   (message ("%s%h%s", 
+                             cstring_fromChars (g_localSpecPath), 
+                             PATH_SEPARATOR,
+                             dir));
+                 /*@=mustfree@*/
+                 /*@switchbreak@*/ break;
+                 BADDEFAULT;
+               }
+           }
+         else if (flagcode_isModeName (opt))
            {
              context_setMode (flagname);
            }
@@ -1615,223 +1747,179 @@ bool flags_processFlags (bool inCommandLine, int argc, char **argv)
              
              if (flagcode_hasArgument (opt))
                {
-                 if (flagcode_isPassThrough (opt)) /* -D or -U */
-                   { 
-                     /*
-                     ** Following space is optional
-                     */
-
-                     flags_recordPassThroughArg (flagname);
-
-                     passThroughArgs = cstringSList_add 
-                       (passThroughArgs, cstring_fromChars (thisarg));
-                   }
-                 else if (flagcode_hasNumber (opt))
+                 if (flagcode_hasNumber (opt))
+                   {
+                     if (++i < argc)
                        {
-                         if (++i < argc)
-                           {
-                             setValueFlag (opt, cstring_fromChars (argv[i]));
-                           }
-                         else
-                           {
-                             llfatalerror 
-                               (message
-                                ("Flag %s must be followed by a number",
-                                 flagcode_unparse (opt)));
-                           }
-                       } 
-                     else if (flagcode_hasChar (opt))
+                         setValueFlag (opt, cstring_fromChars (argv[i]));
+                       }
+                     else
                        {
-                         if (++i < argc)
-                           {
-                             setValueFlag (opt, cstring_fromChars (argv[i]));
-                           }
-                         else
-                           {
-                             llfatalerror 
-                               (message
-                                ("Flag %s must be followed by a character",
-                                 flagcode_unparse (opt)));
-                           }
-                       } 
-                     else if (opt == FLG_INCLUDEPATH || opt == FLG_SPECPATH)
+                         voptgenerror
+                           (FLG_BADFLAG,
+                            message
+                            ("Flag %s must be followed by a number",
+                             flagcode_unparse (opt)),
+                            g_currentloc);
+                       }
+                   } 
+                 else if (flagcode_hasChar (opt))
+                   {
+                     if (++i < argc)
                        {
-                         cstring dir = cstring_suffix (cstring_fromChars (thisarg), 1); /* skip over I */
-                         
-                         switch (opt)
-                           {
-                           case FLG_INCLUDEPATH:
-                             cppAddIncludeDir (dir);
-                             /*@switchbreak@*/ break;
-                           case FLG_SPECPATH:
-                             /*@-mustfree@*/
-                             g_localSpecPath = cstring_toCharsSafe
-                               (message ("%s%h%s", 
-                                         cstring_fromChars (g_localSpecPath), 
-                                         PATH_SEPARATOR,
-                                         dir));
-                             /*@=mustfree@*/
-                             /*@switchbreak@*/ break;
-                             BADDEFAULT;
-                           }
+                         setValueFlag (opt, cstring_fromChars (argv[i]));
+                       }
+                     else
+                       {
+                         voptgenerror
+                           (FLG_BADFLAG,
+                            message
+                            ("Flag %s must be followed by a character",
+                             flagcode_unparse (opt)),
+                            g_currentloc);
                        }
-                     else if (flagcode_hasString (opt)
-                              || opt == FLG_INIT || opt == FLG_OPTF)
+                   } 
+                 else if (flagcode_hasString (opt)
+                          || opt == FLG_INIT || opt == FLG_OPTF)
+                   {
+                     if (++i < argc)
                        {
-                         if (++i < argc)
+                         cstring arg = cstring_fromChars (argv[i]);
+                         
+                         if (opt == FLG_OPTF)
                            {
-                             cstring arg = cstring_fromChars (argv[i]);
-                             
-                             if (opt == FLG_OPTF)
+                             if (inCommandLine)
                                {
                                  ; /* -f already processed */
                                }
-                             else if (opt == FLG_INIT)
+                             else
                                {
+                                 (void) rcfiles_read (arg, passThroughArgs, TRUE);
+                               }
+                           }
+                         else if (opt == FLG_INIT)
+                           {
 # ifndef NOLCL
-                                 initFile = inputStream_create 
-                                   (arg, 
-                                    cstring_makeLiteralTemp (LCLINIT_SUFFIX),
-                                    FALSE);
+                             lslinit_setInitFile (inputStream_create 
+                                                  (arg, 
+                                                   cstring_makeLiteralTemp (LCLINIT_SUFFIX),
+                                                   FALSE));
 # endif
-                                 break;
+                             break;
+                           }
+                         else
+                           {
+                             DPRINTF (("String flag: %s / %s",
+                                       flagcode_unparse (opt), arg));
+                             if (opt == FLG_MTSFILE)
+                               {
+                                 /*
+                                 ** arg identifies mts files
+                                 */
+                                 cstring tmp =  message ("%s%s", arg, MTS_EXTENSION);
+                                 addLarchPathFile (mtfiles, tmp);
+                                 cstring_free (tmp);
+                                 tmp = message ("%s%s", arg, XH_EXTENSION);
+                                 addXHFile (xfiles, tmp);
+                                 cstring_free (tmp);
                                }
                              else
                                {
-                                 DPRINTF (("String flag: %s / %s",
-                                           flagcode_unparse (opt), arg));
-                                 if (opt == FLG_MTSFILE)
-                                   {
-                                     /*
-                                     ** arg identifies mts files
-                                     */
-                                     cstring tmp =  message ("%s%s", arg, MTS_EXTENSION);
-                                     addLarchPathFile (mtfiles, tmp);
-                                     cstring_free (tmp);
-                                     tmp = message ("%s%s", arg, XH_EXTENSION);
-                                     addXHFile (xfiles, tmp);
-                                     cstring_free (tmp);
-                                   }
-                                 else
-                                   {
-                                     setStringFlag (opt, cstring_copy (arg));
-                                   }
+                                 setStringFlag (opt, cstring_copy (arg));
                                }
                            }
-                         else
-                           {
-                             llfatalerror 
-                               (message
-                                ("Flag %s must be followed by a string",
-                                 flagcode_unparse (opt)));
-                           }
                        }
                      else
                        {
-                         /* no argument */
+                         voptgenerror
+                           (FLG_BADFLAG,
+                            message
+                            ("Flag %s must be followed by a string",
+                             flagcode_unparse (opt)),
+                            g_currentloc);
                        }
                    }
+                 else
+                   {
+                     /* no argument */
+                   }
                }
            }
-         else /* its a filename */
-           {
-             DPRINTF (("Adding filename: %s", thisarg));
-             fl = cstringSList_add (fl, cstring_fromChars (thisarg));
-           }
+       }
+      else /* its a filename */
+       {
+         DPRINTF (("Adding filename: %s", thisarg));
+         fl = cstringSList_add (fl, cstring_fromChars (thisarg));
        }
     }
-}
-
-void flags_processHelp (int argc, char **argv)
-{
   
-
-      if (showhelp)
+  /*
+  ** create lists of C and LCL files
+  */
+  
+  if (inCommandLine)
+    {
+      cstringSList_elements (fl, current)
        {
-         if (allhelp)
-           {
-             showHerald ();
-           }
-         
-         allhelp = FALSE;
+         cstring ext = fileLib_getExtension (current);
          
-         if (*thisarg == '-' || *thisarg == '+')
-           {
-             thisarg++;        /* skip '-' */
-           }
-         if (mstring_equal (thisarg, "modes"))
-           {
-             llmsg (describeModes ());
-           }
-         else if (mstring_equal (thisarg, "vars")  || mstring_equal (thisarg, "env"))
-           {
-             describeVars ();
-           }
-         else if (mstring_equal (thisarg, "annotations"))
-           {
-             printAnnotations ();
-           }
-         else if (mstring_equal (thisarg, "parseerrors"))
+         if (cstring_isUndefined (ext))
            {
-             printParseErrors ();
+             /* no extension --- both C and LCL with default extensions */
+             
+             addFile (cfiles, message ("%s%s", current, C_EXTENSION));
+             addFile (lclfiles, message ("%s%s", current, LCL_EXTENSION));
            }
-         else if (mstring_equal (thisarg, "comments"))
+         else if (cstring_equal (ext, XH_EXTENSION))
            {
-             printComments ();
+             addXHFile (xfiles, current);
            }
-         else if (mstring_equal (thisarg, "prefixcodes"))
+         else if (cstring_equal (ext, PP_EXTENSION))
            {
-             describePrefixCodes ();
+             if (!context_getFlag (FLG_NOPP))
+               {
+                 voptgenerror 
+                   (FLG_FILEEXTENSIONS,
+                    message ("File extension %s used without +nopp flag (will be processed as C source code): %s", 
+                             ext, current),
+                    g_currentloc);
+               }
+             
+             addFile (cfiles, cstring_copy (current));
            }
-         else if (mstring_equal (thisarg, "references") 
-                  || mstring_equal (thisarg, "refs"))
+         else if (cstring_equal (ext, LCL_EXTENSION)) 
            {
-             printReferences ();
+             addFile (lclfiles, cstring_copy (current));
            }
-         else if (mstring_equal (thisarg, "mail"))
+         else if (fileLib_isCExtension (ext))
            {
-             printMail ();
+             addFile (cfiles, cstring_copy (current));
            }
-         else if (mstring_equal (thisarg, "maintainer")
-                  || mstring_equal (thisarg, "version"))
+         else if (cstring_equal (ext, MTS_EXTENSION))
            {
-             printMaintainer ();
+             addLarchPathFile (mtfiles, current);
            }
-         else if (mstring_equal (thisarg, "flags"))
+         else 
            {
-             if (i + 1 < argc)
-               {
-                 char *next = argv[i + 1];
-                 
-                 if (specialFlagsHelp (next))
-                   {
-                     i++;
-                   }
-                 else
-                   {
-                     flagkind k = identifyCategory (cstring_fromChars (next));
-                     
-                     if (k != FK_NONE)
-                       {
-                         printCategory (k);
-                         i++;
-                       }
-                   }
-               }
-             else
-               {
-                 printFlags ();
-               }
-           }
-         else
-           {
-             cstring s = describeFlag (cstring_fromChars (thisarg));
+             voptgenerror 
+               (FLG_FILEEXTENSIONS,
+                message ("Unrecognized file extension: %s (assuming %s is C source code)", 
+                         current, ext),
+                g_currentloc);
              
-             if (cstring_isDefined (s))
-               {
-                 llmsg (s);
-               }
+             addFile (cfiles, cstring_copy (current));
            }
-       }
-      else
+       } end_cstringSList_elements;
+    }
+  else
+    {
+      if (cstringSList_size (fl) != 0)
        {
+         /* Cannot list files in .splintrc files */
+         voptgenerror (FLG_BADFLAG, 
+                       message ("Cannot list files in .splintrc files: %s (probable missing + or -)",
+                                cstringSList_unparse (fl)),
+                       g_currentloc);
+       }
+    }
+}
diff --git a/src/help.c b/src/help.c
new file mode 100644 (file)
index 0000000..60f0324
--- /dev/null
@@ -0,0 +1,565 @@
+/*
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2002 University of Virginia,
+**         Massachusetts Institute of Technology
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2 of the License, or (at your
+** option) any later version.
+** 
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+** 
+** The GNU General Public License is available from http://www.gnu.org/ or
+** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+** MA 02111-1307, USA.
+**
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
+** For more information: http://www.splint.org
+*/
+/*
+** help.c
+*/
+
+# include "splintMacros.nf"
+# include "basic.h"
+# include "help.h"
+# include "osd.h"
+# include "portab.h"
+# include "version.h"
+
+static void
+describeVars (void)
+{
+  cstring eval;
+  cstring def;
+
+  eval = context_getLarchPath ();
+  def = osd_getEnvironmentVariable (LARCH_PATH);
+
+  if (cstring_isDefined (def) || 
+      !cstring_equal (eval, cstring_fromChars (DEFAULT_LARCHPATH)))
+    {
+      llmsg (message ("LARCH_PATH = %s", eval));
+    }
+  else
+    {
+      llmsg (message ("LARCH_PATH = <not set> (default = %s)",
+                     cstring_fromChars (DEFAULT_LARCHPATH)));
+    }
+  
+  llmsglit ("   --- path used to find larch initialization files and LSL traits");
+
+  eval = context_getLCLImportDir ();
+  def = osd_getEnvironmentVariable (cstring_makeLiteralTemp (LCLIMPORTDIR));
+
+  if (cstring_isDefined (def) ||
+      !cstring_equal (eval, cstring_fromChars (DEFAULT_LCLIMPORTDIR)))
+    {
+      llmsg (message ("%q = %s", cstring_makeLiteral (LCLIMPORTDIR), eval));
+    }
+  else
+    {
+      llmsg (message ("%s = <not set, default: %s>", cstring_makeLiteralTemp (LCLIMPORTDIR), 
+                     cstring_makeLiteralTemp (DEFAULT_LCLIMPORTDIR))); 
+    }
+  
+  llmsglit ("   --- directory containing lcl standard library files "
+           "(import with < ... >)");;
+
+  llmsg (message 
+        ("include path = %q (set by environment variable %s and -I flags)",
+         cppReader_getIncludePath (), INCLUDEPATH_VAR));
+
+  llmsglit ("   --- path used to find #include'd files");
+
+  llmsg (message 
+        ("systemdirs = %s (set by -systemdirs or environment variable %s)", /*@i413223@*/
+         context_getString (FLG_SYSTEMDIRS),
+         INCLUDEPATH_VAR));
+
+  llmsglit ("   --- if file is found on this path, it is treated as a system file for error reporting");
+}
+
+static void
+printAnnotations (void)
+{
+  llmsglit ("Annotations");
+  llmsglit ("-----------");
+  llmsglit ("");
+  llmsglit ("Annotations are semantic comments that document certain "
+           "assumptions about functions, variables, parameters, and types. ");
+  llmsglit ("");
+  llmsglit ("They may be used to indicate where the representation of a "
+           "user-defined type is hidden, to limit where a global variable may "
+           "be used or modified, to constrain what a function implementation "
+            "may do to its parameters, and to express checked assumptions about "
+           "variables, types, structure fields, function parameters, and "
+           "function results.");
+  llmsglit ("");
+  llmsglit ("Annotations are introduced by \"/*@\". The role of the @ may be "
+           "played by any printable character, selected using -commentchar <char>.");
+  llmsglit ("");
+  llmsglit ("Consult the User's Guide for descriptions of checking associated with each annotation.");
+  llmsglit ("");
+  llmsglit ("Globals: (in function declarations)");
+  llmsglit ("   /*@globals <globitem>,+ @*/");
+  llmsglit ("      globitem is an identifier, internalState or fileSystem");
+  llmsglit ("");
+  llmsglit ("Modifies: (in function declarations)");
+  llmsglit ("   /*@modifies <moditem>,+ @*/");
+  llmsglit ("      moditem is an lvalue");
+  llmsglit ("   /*@modifies nothing @*/");
+  llmsglit ("   /*@*/   (Abbreviation for no globals and modifies nothing.)");
+  llmsglit ("");
+  llmsglit ("Iterators:");
+  llmsglit ("   /*@iter <identifier> (<parameter-type-list>) @*/ - declare an iterator");
+  llmsglit ("");
+  llmsglit ("Constants:");
+  llmsglit ("   /*@constant <declaration> @*/ - declares a constant");
+  llmsglit ("");
+  llmsglit ("Alternate Types:");
+  llmsglit ("   /*@alt <basic-type>,+ @*/");
+  llmsglit ("   (e.g., int /*@alt char@*/ is a type matching either int or char)");
+  llmsglit ("");
+  llmsglit ("Declarator Annotations");
+  llmsglit ("");
+  llmsglit ("Type Definitions:");
+  llmsglit ("   /*@abstract@*/ - representation is hidden from clients");
+  llmsglit ("   /*@concrete@*/ - representation is visible to clients");
+  llmsglit ("   /*@immutable@*/ - instances of the type cannot change value");
+  llmsglit ("   /*@mutable@*/ - instances of the type can change value");
+  llmsglit ("   /*@refcounted@*/ - reference counted type");
+  llmsglit ("");
+  llmsglit ("Global Variables:");
+  llmsglit ("   /*@unchecked@*/ - weakest checking for global use");
+  llmsglit ("   /*@checkmod@*/ - check modification by not use of global");
+  llmsglit ("   /*@checked@*/ - check use and modification of global");
+  llmsglit ("   /*@checkedstrict@*/ - check use of global strictly");
+  llmsglit ("");
+  llmsglit ("Memory Management:");
+  llmsglit ("   /*@dependent@*/ - a reference to externally-owned storage");
+  llmsglit ("   /*@keep@*/ - a parameter that is kept by the called function");
+  llmsglit ("   /*@killref@*/ - a refcounted parameter, killed by the call");
+  llmsglit ("   /*@only@*/ - an unshared reference");
+  llmsglit ("   /*@owned@*/ - owner of storage that may be shared by /*@dependent@*/ references");
+  llmsglit ("   /*@shared@*/ - shared reference that is never deallocated");
+  llmsglit ("   /*@temp@*/ - temporary parameter");
+  llmsglit ("");
+  llmsglit ("Aliasing:");
+  llmsglit ("   /*@unique@*/ - may not be aliased by any other visible reference");
+  llmsglit ("   /*@returned@*/ - may be aliased by the return value");
+  llmsglit ("");
+  llmsglit ("Exposure:");
+  llmsglit ("   /*@observer@*/ - reference that cannot be modified");
+  llmsglit ("   /*@exposed@*/ - exposed reference to storage in another object");
+  llmsglit ("");
+  llmsglit ("Definition State:");
+  llmsglit ("   /*@out@*/ - storage reachable from reference need not be defined");
+  llmsglit ("   /*@in@*/ - all storage reachable from reference must be defined");
+  llmsglit ("   /*@partial@*/ - partially defined, may have undefined fields");
+  llmsglit ("   /*@reldef@*/ - relax definition checking");
+  llmsglit ("");
+  llmsglit ("Global State: (for globals lists, no /*@, since list is already in /*@\'s)");
+  llmsglit ("   undef - variable is undefined before the call");
+  llmsglit ("   killed - variable is undefined after the call");
+  llmsglit ("");
+  llmsglit ("Null State:");
+  llmsglit ("   /*@null@*/ - possibly null pointer");
+  llmsglit ("   /*@notnull@*/ - definitely non-null pointer");
+  llmsglit ("   /*@relnull@*/ - relax null checking");
+  llmsglit ("");
+  llmsglit ("Null Predicates:");
+  llmsglit ("   /*@nullwhentrue@*/ - if result is TRUE, first parameter is NULL");
+  llmsglit ("   /*@falsewhennull@*/ - if result is TRUE, first parameter is not NULL");
+  llmsglit ("");
+  llmsglit ("Execution:");
+  llmsglit ("   /*@noreturn@*/ - function never returns");
+  llmsglit ("   /*@maynotreturn@*/ - function may or may not return");
+  llmsglit ("   /*@noreturnwhentrue@*/ - function does not return if first parameter is TRUE");
+  llmsglit ("   /*@noreturnwhenfalse@*/ - function does not return if first parameter if FALSE");
+  llmsglit ("   /*@alwaysreturns@*/ - function always returns");
+  llmsglit ("");
+  llmsglit ("Side-Effects:");
+  llmsglit ("   /*@sef@*/ - corresponding actual parameter has no side effects");
+  llmsglit ("");
+  llmsglit ("Declaration:");
+  llmsglit ("   /*@unused@*/ - need not be used (no unused errors reported)");
+  llmsglit ("   /*@external@*/ - defined externally (no undefined error reported)");
+  llmsglit ("");
+  llmsglit ("Case:");
+  llmsglit ("   /*@fallthrough@*/ - fall-through case");
+  llmsglit ("");
+  llmsglit ("Break:");
+  llmsglit ("   /*@innerbreak@*/ - break is breaking an inner loop or switch");
+  llmsglit ("   /*@loopbreak@*/ - break is breaking a loop");
+  llmsglit ("   /*@switchbreak@*/ - break is breaking a switch");
+  llmsglit ("   /*@innercontinue@*/ - continue is continuing an inner loop");
+  llmsglit ("");
+  llmsglit ("Unreachable Code:");
+  llmsglit ("   /*@notreached@*/ - statement may be unreachable.");
+  llmsglit ("");
+  llmsglit ("Special Functions:");
+  llmsglit ("   /*@printflike@*/ - check variable arguments like printf");
+  llmsglit ("   /*@scanflike@*/ - check variable arguments like scanf");
+}
+
+static void
+printComments (void)
+{
+  llmsglit ("Control Comments");
+  llmsglit ("----------------");
+  llmsglit ("");
+  llmsglit ("Setting Flags");
+  llmsglit ("");
+  llmsglit ("Most flags (all except those characterized as \"globally-settable only\") can be set locally using control comments. A control comment can set flags locally to override the command line settings. The original flag settings are restored before processing the next file.");
+  llmsglit ("");
+  llmsglit ("The syntax for setting flags in control comments is the same as that of the command line, except that flags may also be preceded by = to restore their setting to the original command-line value. For instance,");
+  llmsglit ("   /*@+boolint -modifies =showfunc@*/");
+  llmsglit ("sets boolint on (this makes bool and int indistinguishable types), sets modifies off (this prevents reporting of modification errors), and sets showfunc to its original setting (this controls  whether or not the name of a function is displayed before a message).");
+  llmsglit ("");
+  llmsglit ("Error Suppression");
+  llmsglit ("");
+  llmsglit ("Several comments are provided for suppressing messages. In general, it is usually better to use specific flags to suppress a particular error permanently, but the general error suppression flags may be more convenient for quickly suppressing messages for code that will be corrected or documented later.");
+  llmsglit ("");
+  llmsglit ("/*@ignore@*/ ... /*@end@*/");
+  llgenindentmsgnoloc
+    (cstring_makeLiteral 
+     ("No errors will be reported in code regions between /*@ignore@*/ and /*@end@*/. These comments can be used to easily suppress an unlimited number of messages."));
+  llmsglit ("/*@i@*/");
+    llgenindentmsgnoloc
+    (cstring_makeLiteral 
+     ("No errors will be reported from an /*@i@*/ comment to the end of the line."));
+  llmsglit ("/*@i<n>@*/");
+  llgenindentmsgnoloc
+    (cstring_makeLiteral 
+     ("No errors will be reported from an /*@i<n>@*/ (e.g., /*@i3@*/) comment to the end of the line. If there are not exactly n errors suppressed from the comment point to the end of the line, Splint will report an error."));
+  llmsglit ("/*@t@*/, /*@t<n>@*/");
+  llgenindentmsgnoloc
+    (cstring_makeLiteral 
+     ("Like i and i<n>, except controlled by +tmpcomments flag. These can be used to temporarily suppress certain errors. Then, -tmpcomments can be set to find them again."));
+  llmsglit ("");
+  llmsglit ("Type Access");
+  llmsglit ("");
+  llmsglit ("/*@access <type>@*/"); 
+  llmsglit ("   Allows the following code to access the representation of <type>");
+  llmsglit ("/*@noaccess <type>@*/");
+  llmsglit ("   Hides the representation of <type>");
+  llmsglit ("");
+  llmsglit ("Macro Expansion");
+  llmsglit ("");
+  llmsglit ("/*@notfunction@*/");
+  llgenindentmsgnoloc 
+    (cstring_makeLiteral
+     ("Indicates that the next macro definition is not intended to be a "
+      "function, and should be expanded in line instead of checked as a "
+      "macro function definition."));
+}
+  
+static void
+printFlags (void)
+{
+  llmsglit ("Flag Categories");
+  llmsglit ("---------------");
+  listAllCategories ();
+  llmsglit ("\nTo see the flags in a flag category, do\n   splint -help flags <category>");
+  llmsglit ("To see a list of all flags in alphabetical order, do\n   splint -help flags alpha");
+  llmsglit ("To see a full description of all flags, do\n   splint -help flags full");
+}
+
+static void
+printMaintainer (void)
+{
+  llmsg (message ("Maintainer: %s", cstring_makeLiteralTemp (SPLINT_MAINTAINER)));
+  llmsglit (LCL_COMPILE);
+}
+
+static void
+printMail (void)
+{
+  llmsglit ("Mailing Lists");
+  llmsglit ("-------------");
+  llmsglit ("");
+  llmsglit ("There are two mailing lists associated with Splint: ");
+  llmsglit ("");
+  llmsglit ("   lclint-announce@virginia.edu");
+  llmsglit ("");
+  llmsglit ("      Reserved for announcements of new releases and bug fixes.");
+  llmsglit ("      To subscribe, send a message to majordomo@virginia.edu with body: ");
+  llmsglit ("           subscribe lclint-announce");
+  llmsglit ("");
+  llmsglit ("   lclint-interest@virginia.edu");
+  llmsglit ("");
+  llmsglit ("      Informal discussions on the use and development of Splint.");
+  llmsglit ("      To subscribe, send a message to majordomo@virginia.edu with body: ");
+  llmsglit ("           subscribe lclint-interest");
+}
+
+static void
+printReferences (void)
+{
+  llmsglit ("References");
+  llmsglit ("----------");
+  llmsglit ("");
+  llmsglit ("For more information, see the Splint web site: http://www.splint.org");
+}
+
+static void
+describePrefixCodes (void)
+{
+  llmsglit ("Prefix Codes");
+  llmsglit ("------------");
+  llmsglit ("");
+  llmsglit ("These characters have special meaning in name prefixes:");
+  llmsglit ("");
+  llmsg (message ("   %h  Any uppercase letter [A-Z]", PFX_UPPERCASE));
+  llmsg (message ("   %h  Any lowercase letter [a-z]", PFX_LOWERCASE));
+  llmsg (message ("   %h  Any character (valid in a C identifier)", PFX_ANY));
+  llmsg (message ("   %h  Any digit [0-9]", PFX_DIGIT));
+  llmsg (message ("   %h  Any non-uppercase letter [a-z0-9_]", PFX_NOTUPPER));
+  llmsg (message ("   %h  Any non-lowercase letter [A-Z0-9_]", PFX_NOTLOWER));
+  llmsg (message ("   %h  Any letter [A-Za-z]", PFX_ANYLETTER));
+  llmsg (message ("   %h  Any letter or digit [A-Za-z0-9]", PFX_ANYLETTERDIGIT));
+  llmsglit ("   *  Zero or more repetitions of the previous character class until the end of the name");
+}
+
+void help_showAvailableHelp (void)
+{
+  showHerald ();
+  
+  llmsg (message ("Source files are .c, .h and %s files.  If there is no suffix,",
+                 LCL_EXTENSION));
+  llmsg (message ("   Splint will look for <file>.c and <file>%s.", LCL_EXTENSION));
+  llmsglit ("");
+  llmsglit ("Use splint -help <topic or flag name> for more information");
+  llmsglit ("");
+  llmsglit ("Topics:");
+  llmsglit ("");
+  llmsglit ("   annotations (describes source-code annotations)");
+  llmsglit ("   comments (describes control comments)");
+  llmsglit ("   flags (describes flag categories)");
+  llmsglit ("   flags <category> (describes flags in category)");
+  llmsglit ("   flags all (short description of all flags)");
+  llmsglit ("   flags alpha (list all flags alphabetically)");
+  llmsglit ("   flags full (full description of all flags)");
+  llmsglit ("   mail (information on mailing lists)");
+  llmsglit ("   modes (show mode settings)");
+  llmsglit ("   parseerrors (help on handling parser errors)");
+  llmsglit ("   prefixcodes (character codes in namespace prefixes)");
+  llmsglit ("   references (sources for more information)");
+  llmsglit ("   vars (environment variables)"); 
+  llmsglit ("   version (information on compilation, maintainer)");
+  llmsglit ("");
+}
+
+static bool
+specialFlagsHelp (char *next)
+{
+  if ((next != NULL) && (*next != '-') && (*next != '+'))
+    {
+      if (mstring_equal (next, "alpha"))
+       {
+         printAlphaFlags ();
+         return TRUE;
+       }
+      else if (mstring_equal (next, "all"))
+       {
+         printAllFlags (TRUE, FALSE);
+         return TRUE;
+       }
+      else if (mstring_equal (next, "categories")
+              || mstring_equal (next, "cats"))
+       {
+         listAllCategories ();
+         return TRUE;
+       }
+      else if (mstring_equal (next, "full"))
+       {
+         printAllFlags (FALSE, TRUE);
+         return TRUE;
+       }
+      else if (mstring_equal (next, "manual"))
+       {
+         printFlagManual (FALSE);
+         return TRUE;
+       }
+      else if (mstring_equal (next, "webmanual"))
+       {
+         printFlagManual (TRUE);
+         return TRUE;
+       }
+      else
+       {
+         return FALSE;
+       }
+    }
+  else
+    {
+      return FALSE;
+    }
+}
+
+static void
+printParseErrors (void)
+{
+  llmsglit ("Parse Errors");
+  llmsglit ("------------");
+  llmsglit ("");
+  llmsglit ("Splint will sometimes encounter a parse error for code that "
+           "can be parsed with a local compiler. There are a few likely "
+           "causes for this and a number of techniques that can be used "
+           "to work around the problem.");
+  llmsglit ("");
+  llmsglit ("Compiler extensions --- compilers sometimes extend the C "
+           "language with compiler-specific keywords and syntax. While "
+           "it is not advisible to use these, oftentimes one has no choice "
+           "when the system header files use compiler extensions. ");
+  llmsglit ("");
+  llmsglit ("Splint supports some of the GNU (gcc) compiler extensions, "
+           "if the +gnuextensions flag is set. You may be able to workaround "
+           "other compiler extensions by using a pre-processor define. "
+           "Alternately, you can surround the unparseable code with");
+  llmsglit ("");
+  llmsglit ("   # ifndef S_SPLINT_S");
+  llmsglit ("   ...");
+  llmsglit ("   # endif");
+  llmsglit ("");
+  /* evans 2000-12-21 fixed typo reported by Jeroen Ruigrok/Asmodai */
+  llmsglit ("Missing type definitions --- an undefined type name will usually "
+           "lead to a parse error. This often occurs when a standard header "
+           "file defines some type that is not part of the standard library. ");
+  llmsglit ("By default, Splint does not process the local files corresponding "
+           "to standard library headers, but uses a library specification "
+           "instead so dependencies on local system headers can be detected. "
+           "If another system header file that does not correspond to a "
+           "standard library header uses one of these superfluous types, "
+           "a parse error will result.");
+  llmsglit ("");
+  llmsglit ("If the parse error is inside a posix standard header file, the "
+           "first thing to try is +posixlib. This makes Splint use "
+           "the posix library specification instead of reading the posix "
+           "header files.");
+  llmsglit ("");
+  llmsglit ("Otherwise, you may need to either manually define the problematic "
+           "type (e.g., add -Dmlink_t=int to your .splintrc file) or force "
+           "splint to process the header file that defines it. This is done "
+           "by setting -skipisoheaders or -skipposixheaders before "
+           "the file that defines the type is #include'd.");
+  llmsglit ("(See splint -help "
+           "skipisoheaders and splint -help skipposixheaders for a list of "
+           "standard headers.)  For example, if <sys/local.h> uses a type "
+           "defined by posix header <sys/types.h> but not defined by the "
+           "posix library, we might do: ");
+  llmsglit ("");
+  llmsglit ("   /*@-skipposixheaders@*/");
+  llmsglit ("   # include <sys/types.h>");
+  llmsglit ("   /*@=skipposixheaders@*/");
+  llmsglit ("   # include <sys/local.h>");
+  llmsglit ("");
+  llmsglit ("to force Splint to process <sys/types.h>.");
+  llmsglit ("");
+  llmsglit ("At last resort, +trytorecover can be used to make Splint attempt "
+           "to continue after a parse error.  This is usually not successful "
+           "and the author does not consider assertion failures when +trytorecover "
+           "is used to be bugs.");
+}
+
+void help_processFlags (int argc, char **argv)
+{
+  int i;
+
+  showHerald ();
+
+  if (argc == 0)
+    {
+      help_showAvailableHelp ();
+    }
+
+  for (i = 0; i < argc; i++)
+    {
+      char *thisarg = argv[i];
+      
+      if (*thisarg == '-' || *thisarg == '+')
+       {
+         thisarg++;    /* skip '-' */
+       }
+      if (mstring_equal (thisarg, "modes"))
+       {
+         llmsg (describeModes ());
+       }
+      else if (mstring_equal (thisarg, "vars")  
+              || mstring_equal (thisarg, "env"))
+       {
+         describeVars ();
+       }
+      else if (mstring_equal (thisarg, "annotations"))
+       {
+         printAnnotations ();
+       }
+      else if (mstring_equal (thisarg, "parseerrors"))
+       {
+         printParseErrors ();
+       }
+      else if (mstring_equal (thisarg, "comments"))
+       {
+         printComments ();
+       }
+      else if (mstring_equal (thisarg, "prefixcodes"))
+       {
+         describePrefixCodes ();
+       }
+      else if (mstring_equal (thisarg, "references") 
+              || mstring_equal (thisarg, "refs"))
+       {
+         printReferences ();
+       }
+      else if (mstring_equal (thisarg, "mail"))
+       {
+         printMail ();
+       }
+      else if (mstring_equal (thisarg, "maintainer")
+              || mstring_equal (thisarg, "version"))
+       {
+         printMaintainer ();
+       }
+      else if (mstring_equal (thisarg, "flags"))
+       {
+         if (i + 1 < argc)
+           {
+             char *next = argv[i + 1];
+             
+             if (specialFlagsHelp (next))
+               {
+                 i++;
+               }
+             else
+               {
+                 flagkind k = identifyCategory (cstring_fromChars (next));
+                 
+                 if (k != FK_NONE)
+                   {
+                     printCategory (k);
+                     i++;
+                   }
+               }
+           }
+         else
+           {
+             printFlags ();
+           }
+       }
+      else
+       {
+         cstring s = describeFlag (cstring_fromChars (thisarg));
+         
+         if (cstring_isDefined (s))
+           {
+             llmsg (s);
+           }
+       }
+    }
+}
index 58a1260e28220c11e2a50cad13fbd6cc570836bb..f6f697a4fc9073d6eff0cca534a69e593ebb8296 100644 (file)
@@ -153,7 +153,7 @@ hasFirstChar (ltoken tok) /*@*/
 }
 
 void
-LCLProcessInitFile (void)
+lclinit_process (void)
 {
   InitLines ();
 
@@ -171,8 +171,6 @@ InitLines (void)
   setCodePoint ();
   InitReduce (INITLINES1);
 
-  
-
   if (ltoken_getCode (nextToken) != LEOFTOKEN)
     {
       InitLine ();
@@ -189,15 +187,14 @@ InitLines (void)
 static void
 InitLine (void)
 {
-  
   if (ltoken_getCode (nextToken) == LLT_EOL)
     {
       /* Nothing on line. */
-            InitReduce (INITLINE1);
+      InitReduce (INITLINE1);
     }
   else
     {
-            Classification ();
+      Classification ();
       InitReduce (INITLINE2);
     }
 
@@ -205,15 +202,14 @@ InitLine (void)
     {
       LocalUserError (nextToken, "Unexpected tokens on line");
     }
-
+  
   nextToken = LCLScanNextToken (); /* Discard EOL      */
-  }
+}
 
 static void
 Classification (void)
 {
   lsymbol ntext = ltoken_getRawText (nextToken);  
-
     
   if (ntext == ltoken_getText (endCommentCharToken)
       || ntext == ltoken_getText (idCharToken)
@@ -251,7 +247,7 @@ Classification (void)
     {
       llbug (message ("Expected character, token, or synonym classification: %s",
                      ltoken_getRawString (nextToken)));
-     /* pop off all tokens on this line */
+      /* pop off all tokens on this line */
     }
 }
 
@@ -259,9 +255,7 @@ static void
 CharClass (void)
 {
   ltoken charClassToken;
-
   charClassToken = nextToken;
-
   nextToken = LCLScanNextToken ();             /* Discard char class keyword. */
 
   if (ltoken_getRawText (charClassToken) == ltoken_getText (endCommentCharToken))
@@ -451,7 +445,7 @@ static void WhiteChar (void) /*@modifies nextToken@*/
 }
 
 static void
-  TokenClass (void) /*@modifies nextToken@*/
+TokenClass (void) /*@modifies nextToken@*/
 {
   ltoken tokenClassToken;
   lsymbol ttext = ltoken_getRawText (nextToken);
@@ -1471,7 +1465,7 @@ static void
  */
 
 void
-LCLProcessInitFileInit (void)
+lclinit_initMod (void)
 {
   int i;
 
@@ -1536,14 +1530,15 @@ LCLProcessInitFileInit (void)
 }
 
 void
-LCLProcessInitFileReset (void)
+lclinit_reset (void)
 {
   nextToken = LCLScanNextToken ();       
 }
 
 void
-LCLProcessInitFileCleanup (void)
+lclinit_cleanup (void)
 {
+  ;
 }
 
 
index 95c9621ed0c1a1632f5c3ca5d192923fb8d982fa..067128dde6c7fc06640c319e68d2e587b849ffc1 100644 (file)
@@ -173,16 +173,7 @@ void llerror_flagWarning (cstring s)
 {
   if (context_getFlag (FLG_WARNFLAGS))
     {
-      showHerald ();
-
-      if (fileloc_isBuiltin (g_currentloc))
-       {
-         llmsg (message ("Warning: %q", s));
-       }
-      else
-       {
-         llgenmsg (message ("Warning: %q", s), g_currentloc);
-       }
+      llgenmsg (s, g_currentloc);
     }
   else
     {
index 0ebce768e3c15e43aaa76eda5ba21cd3f6e01bc7..2a5d46c762f1fc04a6addb21a7d1ade9b0dc3715 100644 (file)
@@ -51,6 +51,7 @@
 # include "splintMacros.nf"
 # include "llbasic.h"
 # include "osd.h"
+# include "help.h"
 
 # ifndef NOLCL
 # include "gram.h"
@@ -70,7 +71,6 @@
 # endif
 
 # include "Headers/version.h" /* Visual C++ finds the wrong version.h */
-# include "fileIdList.h"
 # include "lcllib.h"
 # include "cgrammar.h"
 # include "llmain.h"
 
 
 extern /*@external@*/ int yydebug;
-
-static void printMail (void);
-static void printMaintainer (void);
-static void printReferences (void);
-static void printFlags (void);
-static void printAnnotations (void);
-static void printParseErrors (void);
-static void printComments (void);
-static void describePrefixCodes (void);
 static void cleanupFiles (void);
-static void showHelp (void);
 static void interrupt (int p_i);
 
-static bool readOptionsFile (cstring p_fname,
-                            cstringSList *p_passThroughArgs,
-                            bool p_report) 
-   /*@modifies fileSystem, internalState, *p_passThroughArgs@*/ ;
-   
-static void loadrc (FILE *p_rcfile, cstringSList *p_passThroughArgs)
-   /*@modifies *p_passThroughArgs, p_rcfile@*/
-   /*@ensures closed p_rcfile@*/ ;
-
 static void describeVars (void);
 static bool specialFlagsHelp (char *p_next);
 static bool hasShownHerald = FALSE;
@@ -109,8 +90,6 @@ static char *specFullName (char *p_specfile, /*@out@*/ char **p_inpath)
 static bool anylcl = FALSE;
 static clock_t inittime;
 
-static /*@only@*/ /*@null@*/ inputStream initFile = inputStream_undefined;
-
 static fileIdList preprocessFiles (fileIdList, bool)
   /*@modifies fileSystem@*/ ;
 
@@ -151,163 +130,6 @@ void lslCleanup (void)
   sort_destroyMod (); 
 }
 
-static
-  void lslInit (void)
-  /*@globals undef g_symtab; @*/
-  /*@modifies g_symtab, internalState, fileSystem; @*/
-{
-  /*
-  ** Open init file provided by user, or use the default LCL init file 
-  */
-  
-  cstring larchpath = context_getLarchPath ();
-  inputStream LSLinitFile = inputStream_undefined;
-
-  setCodePoint ();
-
-  if (inputStream_isUndefined (initFile))
-    {
-      initFile = inputStream_create (cstring_makeLiteral (INITFILENAME), 
-                                    cstring_makeLiteralTemp (LCLINIT_SUFFIX),
-                                    FALSE);
-      
-      if (!inputStream_getPath (larchpath, initFile))
-       {
-         lldiagmsg (message ("Continuing without LCL init file: %s",
-                             inputStream_fileName (initFile)));
-       }
-      else 
-       {
-         if (!inputStream_open (initFile))
-           {
-             lldiagmsg (message ("Continuing without LCL init file: %s",
-                                 inputStream_fileName (initFile)));
-           }
-       }
-    }
-  else 
-    {
-      if (!inputStream_open (initFile))
-       {
-         lldiagmsg (message ("Continuing without LCL init file: %s",
-                             inputStream_fileName (initFile)));
-       }
-    }
-
-  /* Initialize checker */
-
-  lsymbol_initMod ();
-  LCLSynTableInit ();
-
-  setCodePoint ();
-
-  LCLSynTableReset ();
-  LCLTokenTableInit ();
-
-  setCodePoint ();
-
-  LCLScanLineInit ();
-  setCodePoint ();
-  LCLScanLineReset ();
-  setCodePoint ();
-  LCLScanInit ();
-
-  setCodePoint ();
-
-  /* need this to initialize LCL checker */
-
-  llassert (inputStream_isDefined (initFile));      
-  if (inputStream_isOpen (initFile))
-    {
-      setCodePoint ();
-
-      LCLScanReset (initFile);
-      LCLProcessInitFileInit ();
-      LCLProcessInitFileReset ();
-
-      setCodePoint ();
-      LCLProcessInitFile ();
-      LCLProcessInitFileCleanup ();
-
-      setCodePoint ();
-      check (inputStream_close (initFile));
-    }
-  
-  /* Initialize LSL init files, for parsing LSL signatures from LSL */
-  
-  LSLinitFile = inputStream_create (cstring_makeLiteral ("lslinit.lsi"), 
-                                   cstring_makeLiteralTemp (".lsi"),
-                                   FALSE);
-  
-  if (!inputStream_getPath (larchpath, LSLinitFile))
-    {
-      lldiagmsg (message ("Continuing without LSL init file: %s",
-                         inputStream_fileName (LSLinitFile)));
-    }
-  else 
-    {
-      if (!inputStream_open (LSLinitFile))
-       {
-         lldiagmsg (message ("Continuing without LSL init file: %s",
-                             inputStream_fileName (LSLinitFile)));
-       }
-    }
-      
-  setCodePoint ();
-  lsynTableInit ();
-  lsynTableReset ();
-
-  setCodePoint ();
-  ltokenTableInit ();
-
-  setCodePoint ();
-  lscanLineInit ();
-  lscanLineReset ();
-  LSLScanInit ();
-
-  if (inputStream_isOpen (LSLinitFile))
-    {
-      setCodePoint ();
-      LSLScanReset (LSLinitFile);
-      LSLProcessInitFileInit ();
-      setCodePoint ();
-      LSLProcessInitFile ();
-      setCodePoint ();
-      check (inputStream_close (LSLinitFile));
-    }
-      
-  inputStream_free (LSLinitFile);
-  
-  if (lclHadError ())
-    {
-      lclplainerror 
-       (cstring_makeLiteral ("LSL init file error.  Attempting to continue."));
-    }
-  
-  setCodePoint ();
-  g_symtab = symtable_new ();
-  
-  /* 
-  ** sort_init must come after symtab has been initialized 
-  */
-  sort_init ();
-  abstract_init ();
-  setCodePoint ();
-  
-  inittime = clock ();
-  
-  /* 
-  ** Equivalent to importing old spec_csupport.lcl
-  ** define immutable LCL type "bool" and bool constants TRUE and FALSE
-  ** and initialized them to be equal to LSL's "true" and "false".
-  **
-  ** Reads in CTrait.syms (derived from CTrait.lsl) on LARCH_PATH.
-  */
-      
-  LCLBuiltins (); 
-  LCLReportEolTokens (FALSE);
-}
-
 static void
 lslProcess (fileIdList lclfiles)
    /*@globals undef g_currentSpec, undef g_currentSpecName, g_currentloc,
@@ -318,8 +140,9 @@ lslProcess (fileIdList lclfiles)
   bool parser_status = FALSE;
   bool overallStatus = FALSE;
   
-  lslInit ();
-  
+  lslinit_process ();
+  inittime = clock ();
+    
   context_resetSpecLines ();
 
   fileIdList_elements (lclfiles, fid)
@@ -534,88 +357,6 @@ void showHerald (void)
     }
 }
 
-static cstring findLarchPathFile (/*@temp@*/ cstring s)
-{
-  cstring pathName;
-  filestatus status;
-  
-  status = osd_getPath (context_getLarchPath (), s, &pathName);
-  
-  if (status == OSD_FILEFOUND)
-    {
-      return pathName;
-    }
-  else if (status == OSD_FILENOTFOUND)
-    {
-      showHerald ();
-      lldiagmsg        (message ("Cannot find file on LARCH_PATH: %s", s));
-    }
-  else if (status == OSD_PATHTOOLONG)
-    {
-      /* Directory and filename are too long.  Report error. */
-      llbuglit ("soure_getPath: Filename plus directory from search path too long");
-    }
-  else
-    {
-      BADBRANCH;
-    }
-
-  return cstring_undefined;
-}
-
-static void addLarchPathFile (fileIdList files, /*@temp@*/ cstring s)
-{
-  cstring pathName = findLarchPathFile (s);
-
-  if (cstring_isDefined (pathName))
-    {
-      if (fileTable_exists (context_fileTable (), pathName))
-       {
-         showHerald ();
-         lldiagmsg (message ("File listed multiple times: %s", pathName));
-         cstring_free (pathName);
-       }
-      else
-       {
-         fileIdList_add (files, fileTable_addFileOnly (context_fileTable (), pathName));
-       }
-    }
-}
-
-static void addFile (fileIdList files, /*@only@*/ cstring s)
-{
-  if (fileTable_exists (context_fileTable (), s))
-    {
-      showHerald ();
-      lldiagmsg (message ("File listed multiple times: %s", s));
-      cstring_free (s);
-    }
-  else
-    {
-      fileIdList_add (files, fileTable_addFileOnly (context_fileTable (), s));
-    }
-}
-
-static void addXHFile (fileIdList files, /*@temp@*/ cstring s)
-{
-  cstring pathName = findLarchPathFile (s);
-
-  if (cstring_isDefined (pathName))
-    {
-      if (fileTable_exists (context_fileTable (), pathName))
-       {
-         showHerald ();
-         lldiagmsg (message ("File listed multiple times: %s", s));
-       }
-      else
-       {
-         fileIdList_add (files, fileTable_addXHFile (context_fileTable (), pathName));
-       }
-    }
-
-  cstring_free (pathName);
-}
-
 /*
 ** Disable MSVC++ warning about return value.  Methinks humbly splint control
 ** comments are a mite more legible.
@@ -636,16 +377,14 @@ int main (int argc, char *argv[])
   @*/
 # else
   /*@globals killed undef g_currentloc,
-            killed undef initFile,
             killed       g_localSpecPath,  
             killed undef g_currentSpec,
             killed undef g_currentSpecName,
             killed undef yyin,
                     undef g_warningstream, g_messagestream, g_errorstream;
    @*/
-  /*@modifies g_currentloc, initFile, 
-              g_localSpecPath, g_currentSpec, g_currentSpecName, fileSystem,
-             yyin; 
+  /*@modifies g_currentloc, g_localSpecPath, g_currentSpec, g_currentSpecName, 
+              fileSystem, yyin; 
   @*/
 # endif
 {
@@ -654,7 +393,6 @@ int main (int argc, char *argv[])
   inputStream sourceFile = inputStream_undefined;
  
   fileIdList dercfiles;
-  cstringSList fl = cstringSList_undefined;
   cstringSList passThroughArgs = cstringSList_undefined;
   fileIdList cfiles, xfiles, lclfiles, mtfiles;
   clock_t before, lcltime, libtime, pptime, cptime, rstime;
@@ -671,11 +409,6 @@ int main (int argc, char *argv[])
   (void) signal (SIGINT, interrupt);
   (void) signal (SIGSEGV, interrupt); 
 
-  cfiles = fileIdList_create ();
-  xfiles = fileIdList_create ();
-  lclfiles = fileIdList_create ();
-  mtfiles = fileIdList_create ();
-
   flags_initMod ();
   clabstract_initMod ();
   typeIdSet_initMod ();
@@ -693,14 +426,18 @@ int main (int argc, char *argv[])
 
   if (argc <= 1)
     {
-      showHelp ();
+      help_showAvailableHelp ();
       llexit (LLSUCCESS);
     }
   
   /* -help must be the first flag to get help */
-  if (flagcode_isHelpFlag (flags_identifyFlag (argv[1])))
+  if (flagcode_isHelpFlag (flags_identifyFlag (cstring_fromChars (argv[1]))))
     {
-      flags_processHelp (argc - 1, argv + 1);
+      /*
+      ** Skip first flag and help flag
+      */
+
+      help_processFlags (argc - 2, argv + 2);
       llexit (LLSUCCESS);
     }
 
@@ -779,6 +516,10 @@ int main (int argc, char *argv[])
   ** check RCFILE for default flags
   */
 
+  /*
+  ** Process command line message formatting flags before reading rc file
+  */
+
   {
     cstring home = osd_getHomeDir ();
     cstring fname  = cstring_undefined;
@@ -826,10 +567,12 @@ int main (int argc, char *argv[])
                      }
                    else
                      {
-                       llfatalerror 
-                         (message
+                       voptgenerror
+                         (FLG_BADFLAG,
+                          message
                           ("Flag %s must be followed by a string",
-                           flagcode_unparse (opt)));
+                           flagcode_unparse (opt)),
+                          g_currentloc);
                      }
                  }
              }
@@ -839,7 +582,7 @@ int main (int argc, char *argv[])
                  {
                    defaultf = FALSE;
                    fname = cstring_fromChars (argv[i]);
-                   (void) readOptionsFile (fname, &passThroughArgs, TRUE);
+                   (void) rcfiles_read (fname, &passThroughArgs, TRUE);
                  }
                else
                  llfatalerror
@@ -870,7 +613,7 @@ int main (int argc, char *argv[])
 
                homename = message ("%s%h%s", home, CONNECTCHAR,
                                 cstring_fromChars (RCFILE));
-               readhomerc = readOptionsFile (homename, &passThroughArgs, FALSE);
+               readhomerc = rcfiles_read (homename, &passThroughArgs, FALSE);
                
                /*
                ** Try ~/.splintrc also for historical accuracy
@@ -878,7 +621,7 @@ int main (int argc, char *argv[])
                
                altname = message ("%s%h%s", home, CONNECTCHAR,
                                 cstring_fromChars (ALTRCFILE));
-               readaltrc = readOptionsFile (altname, &passThroughArgs, FALSE);
+               readaltrc = rcfiles_read (altname, &passThroughArgs, FALSE);
 
                if (readhomerc && readaltrc)
                  {
@@ -905,8 +648,8 @@ int main (int argc, char *argv[])
          cstring altname = message ("%s%s",osd_getCurrentDirectory (), cstring_fromChars (ALTRCFILE));
          bool readrc, readaltrc;
          
-         readrc = readOptionsFile (rcname, &passThroughArgs, FALSE);
-         readaltrc = readOptionsFile (altname, &passThroughArgs, FALSE);
+         readrc = rcfiles_read (rcname, &passThroughArgs, FALSE);
+         readaltrc = rcfiles_read (altname, &passThroughArgs, FALSE);
          
          if (readrc && readaltrc)
            {
@@ -925,83 +668,21 @@ int main (int argc, char *argv[])
   }
   
   setCodePoint ();
+  llassert (fileloc_isBuiltin (g_currentloc));
+
+  cfiles = fileIdList_create ();
+  xfiles = fileIdList_create ();
+  lclfiles = fileIdList_create ();
+  mtfiles = fileIdList_create ();
 
   /* argv[0] is the program name, don't pass it to flags_processFlags */
-  flags_processFlags (argc - 1, argv + 1);
+  flags_processFlags (TRUE, xfiles, cfiles,
+                     lclfiles, mtfiles, 
+                     &passThroughArgs,
+                     argc - 1, argv + 1);
 
   showHerald (); 
   
-  /*
-  ** create lists of C and LCL files
-  */
-
-  cstringSList_elements (fl, current)
-    {
-      cstring ext = fileLib_getExtension (current);
-      
-      if (cstring_isUndefined (ext))
-       {
-         /* no extension --- both C and LCL with default extensions */
-         
-         addFile (cfiles, message ("%s%s", current, C_EXTENSION));
-         addFile (lclfiles, message ("%s%s", current, LCL_EXTENSION));
-       }
-      else if (cstring_equal (ext, XH_EXTENSION))
-       {
-         addXHFile (xfiles, current);
-       }
-      else if (cstring_equal (ext, PP_EXTENSION))
-       {
-         if (!context_getFlag (FLG_NOPP))
-           {
-             voptgenerror 
-               (FLG_FILEEXTENSIONS,
-                message ("File extension %s used without +nopp flag (will be processed as C source code): %s", 
-                         ext, current),
-                g_currentloc);
-           }
-         
-         addFile (cfiles, cstring_copy (current));
-       }
-      else if (cstring_equal (ext, LCL_EXTENSION)) 
-       {
-         addFile (lclfiles, cstring_copy (current));
-       }
-      else if (fileLib_isCExtension (ext))
-       {
-         addFile (cfiles, cstring_copy (current));
-       }
-      else if (cstring_equal (ext, MTS_EXTENSION))
-       {
-         addLarchPathFile (mtfiles, current);
-       }
-      else 
-       {
-         voptgenerror 
-           (FLG_FILEEXTENSIONS,
-            message ("Unrecognized file extension: %s (assuming %s is C source code)", 
-                     current, ext),
-            g_currentloc);
-         
-         addFile (cfiles, cstring_copy (current));
-       }
-    } end_cstringSList_elements;
-  
-  if (showhelp)
-    {
-      if (allhelp)
-       {
-         showHelp ();
-       }
-      fprintf (g_warningstream, "\n");
-
-      fileIdList_free (cfiles);
-      fileIdList_free (xfiles);
-      fileIdList_free (lclfiles);
-      
-      llexit (LLSUCCESS);
-    }
-
 # ifdef DOANNOTS
   initAnnots ();
 # endif
@@ -1077,12 +758,14 @@ int main (int argc, char *argv[])
   */
 
   context_setInCommandLine ();
-
+  
   DPRINTF (("Pass through: %s", cstringSList_unparse (passThroughArgs)));
   
-  cstringSList_elements (passThroughArgs, thisarg) {
-    handlePassThroughFlag (cstring_toCharsSafe (thisarg));
-  } end_cstringSList_elements;
+  cstringSList_elements (passThroughArgs, thisarg)
+    {
+      handlePassThroughFlag (cstring_toCharsSafe (thisarg));
+    } 
+  end_cstringSList_elements;
 
   cstringSList_free (passThroughArgs);
 
@@ -1400,22 +1083,25 @@ int main (int argc, char *argv[])
     {
       clock_t ttime = clock () - before;
       int specLines = context_getSpecLinesProcessed ();
-      
+      cstring specmsg = cstring_undefined;
+
       rstime = clock ();
       
       if (specLines > 0)
        {
-         fprintf (g_warningstream, "%d spec, ", specLines);
+         specmsg = message ("%d spec, ", specLines);
        }
       
 # ifndef CLOCKS_PER_SEC
-      fprintf (g_warningstream, "%d source lines in %ld time steps (steps/sec unknown)\n", 
-              context_getLinesProcessed (), 
-              (long) ttime);
+      lldiagmsg (message ("%s%d source lines in %d time steps (steps/sec unknown)\n", 
+                         specmsg,
+                         context_getLinesProcessed (), 
+                         (int) ttime));
 # else
-      fprintf (g_warningstream, "%d source lines in %.2f s.\n", 
-              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));
 # endif
     }
   else
@@ -1468,444 +1154,6 @@ int main (int argc, char *argv[])
 # pragma warning (default:4035)
 # endif 
 
-void
-showHelp (void)
-{
-  showHerald ();
-  
-  llmsg (message ("Source files are .c, .h and %s files.  If there is no suffix,",
-                 LCL_EXTENSION));
-  llmsg (message ("   Splint will look for <file>.c and <file>%s.", LCL_EXTENSION));
-  llmsglit ("");
-  llmsglit ("Use splint -help <topic or flag name> for more information");
-  llmsglit ("");
-  llmsglit ("Topics:");
-  llmsglit ("");
-  llmsglit ("   annotations (describes source-code annotations)");
-  llmsglit ("   comments (describes control comments)");
-  llmsglit ("   flags (describes flag categories)");
-  llmsglit ("   flags <category> (describes flags in category)");
-  llmsglit ("   flags all (short description of all flags)");
-  llmsglit ("   flags alpha (list all flags alphabetically)");
-  llmsglit ("   flags full (full description of all flags)");
-  llmsglit ("   mail (information on mailing lists)");
-  llmsglit ("   modes (show mode settings)");
-  llmsglit ("   parseerrors (help on handling parser errors)");
-  llmsglit ("   prefixcodes (character codes in namespace prefixes)");
-  llmsglit ("   references (sources for more information)");
-  llmsglit ("   vars (environment variables)"); 
-  llmsglit ("   version (information on compilation, maintainer)");
-  llmsglit ("");
-}
-
-static bool
-specialFlagsHelp (char *next)
-{
-  if ((next != NULL) && (*next != '-') && (*next != '+'))
-    {
-      if (mstring_equal (next, "alpha"))
-       {
-         printAlphaFlags ();
-         return TRUE;
-       }
-      else if (mstring_equal (next, "all"))
-       {
-         printAllFlags (TRUE, FALSE);
-         return TRUE;
-       }
-      else if (mstring_equal (next, "categories")
-              || mstring_equal (next, "cats"))
-       {
-         listAllCategories ();
-         return TRUE;
-       }
-      else if (mstring_equal (next, "full"))
-       {
-         printAllFlags (FALSE, TRUE);
-         return TRUE;
-       }
-      else if (mstring_equal (next, "manual"))
-       {
-         printFlagManual (FALSE);
-         return TRUE;
-       }
-      else if (mstring_equal (next, "webmanual"))
-       {
-         printFlagManual (TRUE);
-         return TRUE;
-       }
-      else
-       {
-         return FALSE;
-       }
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-void
-printParseErrors (void)
-{
-  llmsglit ("Parse Errors");
-  llmsglit ("------------");
-  llmsglit ("");
-  llmsglit ("Splint will sometimes encounter a parse error for code that "
-           "can be parsed with a local compiler. There are a few likely "
-           "causes for this and a number of techniques that can be used "
-           "to work around the problem.");
-  llmsglit ("");
-  llmsglit ("Compiler extensions --- compilers sometimes extend the C "
-           "language with compiler-specific keywords and syntax. While "
-           "it is not advisible to use these, oftentimes one has no choice "
-           "when the system header files use compiler extensions. ");
-  llmsglit ("");
-  llmsglit ("Splint supports some of the GNU (gcc) compiler extensions, "
-           "if the +gnuextensions flag is set. You may be able to workaround "
-           "other compiler extensions by using a pre-processor define. "
-           "Alternately, you can surround the unparseable code with");
-  llmsglit ("");
-  llmsglit ("   # ifndef S_SPLINT_S");
-  llmsglit ("   ...");
-  llmsglit ("   # endif");
-  llmsglit ("");
-  /* evans 2000-12-21 fixed typo reported by Jeroen Ruigrok/Asmodai */
-  llmsglit ("Missing type definitions --- an undefined type name will usually "
-           "lead to a parse error. This often occurs when a standard header "
-           "file defines some type that is not part of the standard library. ");
-  llmsglit ("By default, Splint does not process the local files corresponding "
-           "to standard library headers, but uses a library specification "
-           "instead so dependencies on local system headers can be detected. "
-           "If another system header file that does not correspond to a "
-           "standard library header uses one of these superfluous types, "
-           "a parse error will result.");
-  llmsglit ("");
-  llmsglit ("If the parse error is inside a posix standard header file, the "
-           "first thing to try is +posixlib. This makes Splint use "
-           "the posix library specification instead of reading the posix "
-           "header files.");
-  llmsglit ("");
-  llmsglit ("Otherwise, you may need to either manually define the problematic "
-           "type (e.g., add -Dmlink_t=int to your .splintrc file) or force "
-           "splint to process the header file that defines it. This is done "
-           "by setting -skipisoheaders or -skipposixheaders before "
-           "the file that defines the type is #include'd.");
-  llmsglit ("(See splint -help "
-           "skipisoheaders and splint -help skipposixheaders for a list of "
-           "standard headers.)  For example, if <sys/local.h> uses a type "
-           "defined by posix header <sys/types.h> but not defined by the "
-           "posix library, we might do: ");
-  llmsglit ("");
-  llmsglit ("   /*@-skipposixheaders@*/");
-  llmsglit ("   # include <sys/types.h>");
-  llmsglit ("   /*@=skipposixheaders@*/");
-  llmsglit ("   # include <sys/local.h>");
-  llmsglit ("");
-  llmsglit ("to force Splint to process <sys/types.h>.");
-  llmsglit ("");
-  llmsglit ("At last resort, +trytorecover can be used to make Splint attempt "
-           "to continue after a parse error.  This is usually not successful "
-           "and the author does not consider assertion failures when +trytorecover "
-           "is used to be bugs.");
-}
-
-void
-printAnnotations (void)
-{
-  llmsglit ("Annotations");
-  llmsglit ("-----------");
-  llmsglit ("");
-  llmsglit ("Annotations are semantic comments that document certain "
-           "assumptions about functions, variables, parameters, and types. ");
-  llmsglit ("");
-  llmsglit ("They may be used to indicate where the representation of a "
-           "user-defined type is hidden, to limit where a global variable may "
-           "be used or modified, to constrain what a function implementation "
-            "may do to its parameters, and to express checked assumptions about "
-           "variables, types, structure fields, function parameters, and "
-           "function results.");
-  llmsglit ("");
-  llmsglit ("Annotations are introduced by \"/*@\". The role of the @ may be "
-           "played by any printable character, selected using -commentchar <char>.");
-  llmsglit ("");
-  llmsglit ("Consult the User's Guide for descriptions of checking associated with each annotation.");
-  llmsglit ("");
-  llmsglit ("Globals: (in function declarations)");
-  llmsglit ("   /*@globals <globitem>,+ @*/");
-  llmsglit ("      globitem is an identifier, internalState or fileSystem");
-  llmsglit ("");
-  llmsglit ("Modifies: (in function declarations)");
-  llmsglit ("   /*@modifies <moditem>,+ @*/");
-  llmsglit ("      moditem is an lvalue");
-  llmsglit ("   /*@modifies nothing @*/");
-  llmsglit ("   /*@*/   (Abbreviation for no globals and modifies nothing.)");
-  llmsglit ("");
-  llmsglit ("Iterators:");
-  llmsglit ("   /*@iter <identifier> (<parameter-type-list>) @*/ - declare an iterator");
-  llmsglit ("");
-  llmsglit ("Constants:");
-  llmsglit ("   /*@constant <declaration> @*/ - declares a constant");
-  llmsglit ("");
-  llmsglit ("Alternate Types:");
-  llmsglit ("   /*@alt <basic-type>,+ @*/");
-  llmsglit ("   (e.g., int /*@alt char@*/ is a type matching either int or char)");
-  llmsglit ("");
-  llmsglit ("Declarator Annotations");
-  llmsglit ("");
-  llmsglit ("Type Definitions:");
-  llmsglit ("   /*@abstract@*/ - representation is hidden from clients");
-  llmsglit ("   /*@concrete@*/ - representation is visible to clients");
-  llmsglit ("   /*@immutable@*/ - instances of the type cannot change value");
-  llmsglit ("   /*@mutable@*/ - instances of the type can change value");
-  llmsglit ("   /*@refcounted@*/ - reference counted type");
-  llmsglit ("");
-  llmsglit ("Global Variables:");
-  llmsglit ("   /*@unchecked@*/ - weakest checking for global use");
-  llmsglit ("   /*@checkmod@*/ - check modification by not use of global");
-  llmsglit ("   /*@checked@*/ - check use and modification of global");
-  llmsglit ("   /*@checkedstrict@*/ - check use of global strictly");
-  llmsglit ("");
-  llmsglit ("Memory Management:");
-  llmsglit ("   /*@dependent@*/ - a reference to externally-owned storage");
-  llmsglit ("   /*@keep@*/ - a parameter that is kept by the called function");
-  llmsglit ("   /*@killref@*/ - a refcounted parameter, killed by the call");
-  llmsglit ("   /*@only@*/ - an unshared reference");
-  llmsglit ("   /*@owned@*/ - owner of storage that may be shared by /*@dependent@*/ references");
-  llmsglit ("   /*@shared@*/ - shared reference that is never deallocated");
-  llmsglit ("   /*@temp@*/ - temporary parameter");
-  llmsglit ("");
-  llmsglit ("Aliasing:");
-  llmsglit ("   /*@unique@*/ - may not be aliased by any other visible reference");
-  llmsglit ("   /*@returned@*/ - may be aliased by the return value");
-  llmsglit ("");
-  llmsglit ("Exposure:");
-  llmsglit ("   /*@observer@*/ - reference that cannot be modified");
-  llmsglit ("   /*@exposed@*/ - exposed reference to storage in another object");
-  llmsglit ("");
-  llmsglit ("Definition State:");
-  llmsglit ("   /*@out@*/ - storage reachable from reference need not be defined");
-  llmsglit ("   /*@in@*/ - all storage reachable from reference must be defined");
-  llmsglit ("   /*@partial@*/ - partially defined, may have undefined fields");
-  llmsglit ("   /*@reldef@*/ - relax definition checking");
-  llmsglit ("");
-  llmsglit ("Global State: (for globals lists, no /*@, since list is already in /*@\'s)");
-  llmsglit ("   undef - variable is undefined before the call");
-  llmsglit ("   killed - variable is undefined after the call");
-  llmsglit ("");
-  llmsglit ("Null State:");
-  llmsglit ("   /*@null@*/ - possibly null pointer");
-  llmsglit ("   /*@notnull@*/ - definitely non-null pointer");
-  llmsglit ("   /*@relnull@*/ - relax null checking");
-  llmsglit ("");
-  llmsglit ("Null Predicates:");
-  llmsglit ("   /*@nullwhentrue@*/ - if result is TRUE, first parameter is NULL");
-  llmsglit ("   /*@falsewhennull@*/ - if result is TRUE, first parameter is not NULL");
-  llmsglit ("");
-  llmsglit ("Execution:");
-  llmsglit ("   /*@noreturn@*/ - function never returns");
-  llmsglit ("   /*@maynotreturn@*/ - function may or may not return");
-  llmsglit ("   /*@noreturnwhentrue@*/ - function does not return if first parameter is TRUE");
-  llmsglit ("   /*@noreturnwhenfalse@*/ - function does not return if first parameter if FALSE");
-  llmsglit ("   /*@alwaysreturns@*/ - function always returns");
-  llmsglit ("");
-  llmsglit ("Side-Effects:");
-  llmsglit ("   /*@sef@*/ - corresponding actual parameter has no side effects");
-  llmsglit ("");
-  llmsglit ("Declaration:");
-  llmsglit ("   /*@unused@*/ - need not be used (no unused errors reported)");
-  llmsglit ("   /*@external@*/ - defined externally (no undefined error reported)");
-  llmsglit ("");
-  llmsglit ("Case:");
-  llmsglit ("   /*@fallthrough@*/ - fall-through case");
-  llmsglit ("");
-  llmsglit ("Break:");
-  llmsglit ("   /*@innerbreak@*/ - break is breaking an inner loop or switch");
-  llmsglit ("   /*@loopbreak@*/ - break is breaking a loop");
-  llmsglit ("   /*@switchbreak@*/ - break is breaking a switch");
-  llmsglit ("   /*@innercontinue@*/ - continue is continuing an inner loop");
-  llmsglit ("");
-  llmsglit ("Unreachable Code:");
-  llmsglit ("   /*@notreached@*/ - statement may be unreachable.");
-  llmsglit ("");
-  llmsglit ("Special Functions:");
-  llmsglit ("   /*@printflike@*/ - check variable arguments like printf");
-  llmsglit ("   /*@scanflike@*/ - check variable arguments like scanf");
-}
-
-void
-printComments (void)
-{
-  llmsglit ("Control Comments");
-  llmsglit ("----------------");
-  llmsglit ("");
-  llmsglit ("Setting Flags");
-  llmsglit ("");
-  llmsglit ("Most flags (all except those characterized as \"globally-settable only\") can be set locally using control comments. A control comment can set flags locally to override the command line settings. The original flag settings are restored before processing the next file.");
-  llmsglit ("");
-  llmsglit ("The syntax for setting flags in control comments is the same as that of the command line, except that flags may also be preceded by = to restore their setting to the original command-line value. For instance,");
-  llmsglit ("   /*@+boolint -modifies =showfunc@*/");
-  llmsglit ("sets boolint on (this makes bool and int indistinguishable types), sets modifies off (this prevents reporting of modification errors), and sets showfunc to its original setting (this controls  whether or not the name of a function is displayed before a message).");
-  llmsglit ("");
-  llmsglit ("Error Suppression");
-  llmsglit ("");
-  llmsglit ("Several comments are provided for suppressing messages. In general, it is usually better to use specific flags to suppress a particular error permanently, but the general error suppression flags may be more convenient for quickly suppressing messages for code that will be corrected or documented later.");
-  llmsglit ("");
-  llmsglit ("/*@ignore@*/ ... /*@end@*/");
-  llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("No errors will be reported in code regions between /*@ignore@*/ and /*@end@*/. These comments can be used to easily suppress an unlimited number of messages."));
-  llmsglit ("/*@i@*/");
-    llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("No errors will be reported from an /*@i@*/ comment to the end of the line."));
-  llmsglit ("/*@i<n>@*/");
-  llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("No errors will be reported from an /*@i<n>@*/ (e.g., /*@i3@*/) comment to the end of the line. If there are not exactly n errors suppressed from the comment point to the end of the line, Splint will report an error."));
-  llmsglit ("/*@t@*/, /*@t<n>@*/");
-  llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("Like i and i<n>, except controlled by +tmpcomments flag. These can be used to temporarily suppress certain errors. Then, -tmpcomments can be set to find them again."));
-  llmsglit ("");
-  llmsglit ("Type Access");
-  llmsglit ("");
-  llmsglit ("/*@access <type>@*/"); 
-  llmsglit ("   Allows the following code to access the representation of <type>");
-  llmsglit ("/*@noaccess <type>@*/");
-  llmsglit ("   Hides the representation of <type>");
-  llmsglit ("");
-  llmsglit ("Macro Expansion");
-  llmsglit ("");
-  llmsglit ("/*@notfunction@*/");
-  llgenindentmsgnoloc 
-    (cstring_makeLiteral
-     ("Indicates that the next macro definition is not intended to be a "
-      "function, and should be expanded in line instead of checked as a "
-      "macro function definition."));
-}
-
-  
-void
-printFlags (void)
-{
-  llmsglit ("Flag Categories");
-  llmsglit ("---------------");
-  listAllCategories ();
-  llmsglit ("\nTo see the flags in a flag category, do\n   splint -help flags <category>");
-  llmsglit ("To see a list of all flags in alphabetical order, do\n   splint -help flags alpha");
-  llmsglit ("To see a full description of all flags, do\n   splint -help flags full");
-}
-
-void
-printMaintainer (void)
-{
-  llmsg (message ("Maintainer: %s", cstring_makeLiteralTemp (SPLINT_MAINTAINER)));
-  llmsglit (LCL_COMPILE);
-}
-
-void
-printMail (void)
-{
-  llmsglit ("Mailing Lists");
-  llmsglit ("-------------");
-  llmsglit ("");
-  llmsglit ("There are two mailing lists associated with Splint: ");
-  llmsglit ("");
-  llmsglit ("   lclint-announce@virginia.edu");
-  llmsglit ("");
-  llmsglit ("      Reserved for announcements of new releases and bug fixes.");
-  llmsglit ("      To subscribe, send a message to majordomo@virginia.edu with body: ");
-  llmsglit ("           subscribe lclint-announce");
-  llmsglit ("");
-  llmsglit ("   lclint-interest@virginia.edu");
-  llmsglit ("");
-  llmsglit ("      Informal discussions on the use and development of Splint.");
-  llmsglit ("      To subscribe, send a message to majordomo@virginia.edu with body: ");
-  llmsglit ("           subscribe lclint-interest");
-}
-
-void
-printReferences (void)
-{
-  llmsglit ("References");
-  llmsglit ("----------");
-  llmsglit ("");
-  llmsglit ("For more information, see the Splint web site: http://www.splint.org");
-}
-
-void
-describePrefixCodes (void)
-{
-  llmsglit ("Prefix Codes");
-  llmsglit ("------------");
-  llmsglit ("");
-  llmsglit ("These characters have special meaning in name prefixes:");
-  llmsglit ("");
-  llmsg (message ("   %h  Any uppercase letter [A-Z]", PFX_UPPERCASE));
-  llmsg (message ("   %h  Any lowercase letter [a-z]", PFX_LOWERCASE));
-  llmsg (message ("   %h  Any character (valid in a C identifier)", PFX_ANY));
-  llmsg (message ("   %h  Any digit [0-9]", PFX_DIGIT));
-  llmsg (message ("   %h  Any non-uppercase letter [a-z0-9_]", PFX_NOTUPPER));
-  llmsg (message ("   %h  Any non-lowercase letter [A-Z0-9_]", PFX_NOTLOWER));
-  llmsg (message ("   %h  Any letter [A-Za-z]", PFX_ANYLETTER));
-  llmsg (message ("   %h  Any letter or digit [A-Za-z0-9]", PFX_ANYLETTERDIGIT));
-  llmsglit ("   *  Zero or more repetitions of the previous character class until the end of the name");
-}
-
-void
-describeVars (void)
-{
-  cstring eval;
-  cstring def;
-
-  eval = context_getLarchPath ();
-  def = osd_getEnvironmentVariable (LARCH_PATH);
-
-  if (cstring_isDefined (def) || 
-      !cstring_equal (eval, cstring_fromChars (DEFAULT_LARCHPATH)))
-    {
-      llmsg (message ("LARCH_PATH = %s", eval));
-    }
-  else
-    {
-      llmsg (message ("LARCH_PATH = <not set> (default = %s)",
-                     cstring_fromChars (DEFAULT_LARCHPATH)));
-    }
-  
-  llmsglit ("   --- path used to find larch initialization files and LSL traits");
-
-  eval = context_getLCLImportDir ();
-  def = osd_getEnvironmentVariable (cstring_makeLiteralTemp (LCLIMPORTDIR));
-
-  if (cstring_isDefined (def) ||
-      !cstring_equal (eval, cstring_fromChars (DEFAULT_LCLIMPORTDIR)))
-    {
-      llmsg (message ("%q = %s", cstring_makeLiteral (LCLIMPORTDIR), eval));
-    }
-  else
-    {
-      llmsg (message ("%s = <not set, default: %s>", cstring_makeLiteralTemp (LCLIMPORTDIR), 
-                     cstring_makeLiteralTemp (DEFAULT_LCLIMPORTDIR))); 
-    }
-  
-  llmsglit ("   --- directory containing lcl standard library files "
-           "(import with < ... >)");;
-
-  llmsg (message 
-        ("include path = %q (set by environment variable %s and -I flags)",
-         cppReader_getIncludePath (), INCLUDEPATH_VAR));
-
-  llmsglit ("   --- path used to find #include'd files");
-
-  llmsg (message 
-        ("systemdirs = %s (set by -systemdirs or environment variable %s)", /*@i413223@*/
-         context_getString (FLG_SYSTEMDIRS),
-         INCLUDEPATH_VAR));
-
-  llmsglit ("   --- if file is found on this path, it is treated as a system file for error reporting");
-}
-
 void
 interrupt (int i)
 {
@@ -2021,384 +1269,6 @@ llexit (int status)
   exit ((status == LLSUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
-bool readOptionsFile (cstring fname, cstringSList *passThroughArgs, bool report)
-{
-  bool res = FALSE;
-
-  if (fileTable_exists (context_fileTable (), fname))
-    {
-      if (report)
-       {
-         voptgenerror
-           (FLG_WARNRC, 
-            message ("Multiple attempts to read options file: %s", fname),
-            g_currentloc);
-       }
-    }
-  else
-    {
-      FILE *innerf = fileTable_openReadFile (context_fileTable (), fname);
-      
-      if (innerf != NULL)
-       {
-         fileloc fc = g_currentloc;
-         g_currentloc = fileloc_createRc (fname);
-
-         displayScan (message ("< reading options from %q >", 
-                               fileloc_outputFilename (g_currentloc)));
-         
-         loadrc (innerf, passThroughArgs);
-         fileloc_reallyFree (g_currentloc);
-         g_currentloc = fc;
-         res = TRUE;
-       }
-      else 
-       {
-         if (report)
-           {
-             voptgenerror
-               (FLG_WARNRC, 
-                message ("Cannot open options file: %s", fname),
-                g_currentloc);
-           }
-       }
-    }
-
-  return res;
-}
-
-/*
-** This shouldn't be necessary, but Apple Darwin can't handle '"''s.
-*/
-
-void
-loadrc (/*:open:*/ FILE *rcfile, cstringSList *passThroughArgs)
-   /*@modifies rcfile@*/
-   /*@ensures closed rcfile@*/
-{
-  char *s = mstring_create (MAX_LINE_LENGTH);
-  char *os = s;
-  
-  DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-
-  s = os;
-
-  while (reader_readLine (rcfile, s, MAX_LINE_LENGTH) != NULL)
-    {
-      char c;
-      bool set = FALSE;            
-      char *thisflag;
-      flagcode opt;
-
-      DPRINTF (("Line: %s", s));
-      DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-            
-      while (*s == ' ' || *s == '\t')
-       {
-         s++;
-         incColumn ();
-       }
-      
-      while (*s != '\0')
-       {
-         bool escaped = FALSE;
-         bool quoted = FALSE;
-         c = *s;
-
-         DPRINTF (("Process: %s", s));
-         DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-         /* comment characters */
-         if (c == '#' || c == ';' || c == '\n') 
-           {
-             /*@innerbreak@*/
-             break;
-           }
-         
-         if (c == '-' || c == '+')
-           {
-             set = (c == '+');
-           }
-         else
-           {
-             showHerald ();
-             voptgenerror (FLG_BADFLAG, 
-                           message ("Bad flag syntax (+ or - expected, "
-                                    "+ is assumed): %s", 
-                                    cstring_fromChars (s)),
-                           g_currentloc);
-             s--;
-             set = TRUE;
-           }
-         
-         s++;
-         incColumn ();
-         
-         thisflag = s;
-         
-         while ((c = *s) != '\0')
-           { /* remember to handle spaces and quotes in -D and -U ... */
-             if (escaped)
-               {
-                 escaped = FALSE;
-               }
-             else if (quoted)
-               {
-                 if (c == '\\')
-                   {
-                     escaped = TRUE;
-                   }
-                 else if (c == '\"')
-                   {
-                     quoted = FALSE;
-                   }
-                 else
-                   {
-                     ;
-                   }
-               }
-             else if (c == '\"')
-               {
-                 quoted = TRUE;
-               }
-             else
-               {
-                if (c == ' ' || c == '\t' || c == '\n')
-                  {
-                    /*@innerbreak@*/ break;
-                  }
-              }
-                 
-             s++; 
-             incColumn ();
-           }
-
-         DPRINTF (("Nulling: %c", *s));
-         *s = '\0';
-
-         if (mstring_isEmpty (thisflag))
-           {
-             llfatalerror (message ("Missing flag: %s",
-                                    cstring_fromChars (os)));
-           }
-
-         DPRINTF (("Flag: %s", thisflag));
-
-         opt = flags_identifyFlag (cstring_fromChars (thisflag));
-         
-         if (flagcode_isSkip (opt))
-           {
-             ;
-           }
-         else if (flagcode_isInvalid (opt))
-           {
-             DPRINTF (("Invalid: %s", thisflag));
-
-             if (flags_isModeName (cstring_fromChars (thisflag)))
-               {
-                 context_setMode (cstring_fromChars (thisflag));
-               }
-             else
-               {
-                 voptgenerror (FLG_BADFLAG,
-                               message ("Unrecognized option: %s", 
-                                        cstring_fromChars (thisflag)),
-                               g_currentloc);
-               }
-           }
-         else
-           {
-             context_userSetFlag (opt, set);
-
-             if (flagcode_hasArgument (opt))
-               {
-                 if (opt == FLG_HELP)
-                   {
-                     showHerald ();
-                     voptgenerror (FLG_BADFLAG,
-                                   message ("Cannot use help in rc files"),
-                                   g_currentloc);
-                   }
-                 else if (flagcode_isPassThrough (opt)) /* -D or -U */
-                   {
-                     cstring arg = cstring_fromCharsNew (thisflag);
-                     cstring_markOwned (arg);
-                     *passThroughArgs = cstringSList_add (*passThroughArgs, arg);
-                     DPRINTF (("Pass through: %s",
-                               cstringSList_unparse (*passThroughArgs)));
-                   }
-                 else if (opt == FLG_INCLUDEPATH 
-                          || opt == FLG_SPECPATH)
-                   {
-                     cstring dir;
-
-                     /*
-                     ** Either -I<dir> or -I <dir>
-                     */
-
-                     if (cstring_length (thisflag) > 1)
-                       {
-                         dir = cstring_suffix (cstring_fromChars (thisflag), 1); /* skip over I/S */
-                       }
-                     else
-                       {
-                         BADBRANCH; /*@!!!!@*/
-                       }
-                                     
-                     switch (opt)
-                       {
-                       case FLG_INCLUDEPATH:
-                         cppAddIncludeDir (dir);
-                         /*@switchbreak@*/ break;
-                       case FLG_SPECPATH:
-                         /*@-mustfree@*/
-                         g_localSpecPath = cstring_toCharsSafe
-                           (message ("%s:%s", cstring_fromChars (g_localSpecPath), dir));
-                         /*@=mustfree@*/
-                         /*@switchbreak@*/ break;
-                         BADDEFAULT;
-                       }
-                   }
-                 else if (flagcode_hasString (opt)
-                          || flagcode_hasNumber (opt)
-                          || flagcode_hasChar (opt)
-                          || opt == FLG_INIT || opt == FLG_OPTF)
-                   {
-                     cstring extra = cstring_undefined;
-                     char *rest, *orest;
-                     char rchar;
-                     
-                     *s = c;
-                     rest = mstring_copy (s);
-                     DPRINTF (("Here: rest = %s", rest));
-                     orest = rest;
-                     *s = '\0';
-                     
-                     while ((rchar = *rest) != '\0'
-                            && (isspace ((int) rchar)))
-                       {
-                         rest++;
-                         s++;
-                       }
-                     
-                     DPRINTF (("Yo: %s", rest));
-
-                     while ((rchar = *rest) != '\0' 
-                            && !isspace ((int) rchar))
-                       {
-                         extra = cstring_appendChar (extra, rchar);
-                         rest++; 
-                         s++;
-                       }
-                     
-                     DPRINTF (("Yo: %s", extra));
-                     sfree (orest);
-
-                     if (cstring_isUndefined (extra))
-                       {
-                         showHerald ();
-                         voptgenerror 
-                           (FLG_BADFLAG,
-                            message
-                            ("Flag %s must be followed by an argument",
-                             flagcode_unparse (opt)),
-                            g_currentloc);
-                       }
-                     else
-                       {
-                         s--;
-                         
-                         DPRINTF (("Here we are: %s", extra));
-
-                         if (flagcode_hasNumber (opt) || flagcode_hasChar (opt))
-                           {
-                             DPRINTF (("Set value flag: %s", extra));
-                             setValueFlag (opt, extra);
-                           }
-                         else if (opt == FLG_OPTF)
-                           {
-                             (void) readOptionsFile (extra, passThroughArgs, TRUE);
-                           }
-                         else if (opt == FLG_INIT)
-                           {
-# ifndef NOLCL
-                             llassert (inputStream_isUndefined (initFile));
-                             
-                             initFile = inputStream_create 
-                               (cstring_copy (extra), 
-                                cstring_makeLiteralTemp (LCLINIT_SUFFIX),
-                                FALSE);
-# endif
-                           }
-                         else if (flagcode_hasString (opt))
-                           {
-                             DPRINTF (("Here: %s", extra));
-
-                             /*
-                             ** If it has "'s, we need to remove them.
-                             */
-
-                             if (cstring_firstChar (extra) == '\"')
-                               {
-                                 if (cstring_lastChar (extra) == '\"')
-                                   {
-                                     cstring unquoted = cstring_copyLength 
-                                       (cstring_toCharsSafe (cstring_suffix (extra, 1)),
-                                        cstring_length (extra) - 2);
-
-                                     DPRINTF (("string flag: %s -> %s", extra, unquoted));
-                                     setStringFlag (opt, unquoted);
-                                     cstring_free (extra);
-                                   }
-                                 else
-                                   {
-                                     voptgenerror
-                                       (FLG_BADFLAG, 
-                                        message ("Unmatched \" in option string: %s", 
-                                                 extra),
-                                        g_currentloc);
-                                     setStringFlag (opt, extra);
-                                   }
-                               }
-                             else
-                               {
-                                 DPRINTF (("No quotes: %s", extra));
-                                 setStringFlag (opt, extra);
-                               }
-
-                             extra = cstring_undefined;
-                           }
-                         else
-                           {
-                             BADEXIT;
-                           }
-                       }
-
-                     cstring_free (extra); 
-                   }
-                 else
-                   {
-                     BADEXIT;
-                   }
-               }
-           }
-         
-         *s = c;
-         DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-         while ((c == ' ') || (c == '\t'))
-           {
-             c = *(++s);
-             incColumn ();
-           } 
-       }
-      DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-      s = os;
-    }
-
-  DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-  sfree (os); 
-  check (fileTable_closeFile (context_fileTable (), rcfile));
-}
-
 static fileIdList preprocessFiles (fileIdList fl, bool xhfiles)
   /*@modifies fileSystem@*/
 {
@@ -2436,13 +1306,11 @@ static fileIdList preprocessFiles (fileIdList fl, bool xhfiles)
              if ((filesprocessed % skip) == 0) 
                {
                  if (filesprocessed == 0) {
-                   fprintf (g_messagestream, " ");
+                   displayScan (cstring_makeLiteral (" "));
                  }
                  else {
-                   fprintf (g_messagestream, ".");
+                   displayScan (cstring_makeLiteral ("."));
                  }
-                 
-                 (void) fflush (g_messagestream);
                }
              filesprocessed++;
            }
diff --git a/src/lslinit.c b/src/lslinit.c
deleted file mode 100644 (file)
index 01fbdad..0000000
+++ /dev/null
@@ -1,1555 +0,0 @@
-/*
-** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on splint: info@splint.org
-** To report a bug: splint-bug@splint.org
-** For more information: http://www.splint.org
-*/
-/*
-** lslinit.c
-**
-** Processor for Larch Shared Language Init Files
-*/
-
-# include "splintMacros.nf"
-# include "llbasic.h"
-# include "signature.h"
-# include "signature2.h"
-# include "scan.h"
-# include "scanline.h"
-# include "tokentable.h"
-# include "syntable.h"
-# include "lslinit.h"
-
-/* needed to parse init files */
-# include "shift.h"
-#if TRACING == 1
-/*@notfunction@*/
-# define LTRACE(rule) printf ("Reducing: %s\n", rule)
-#else
-/*@notfunction@*/
-# define LTRACE(rule)
-#endif
-
-static void LocalUserError (ltoken p_t, /*@temp@*/ char *p_msg)
-  /*@modifies *g_warningstream@*/;
-
-static /*@only@*/ ltoken nextToken;
-
-static void InitFile (void) /*@modifies nextToken@*/ ;
-static void InitLines (void) /*@modifies nextToken@*/ ;
-static void InitLine (void) /*@modifies nextToken@*/ ;
-static void Classification (void) /*@modifies nextToken@*/ ;
-static void CharClass (void) /*@modifies nextToken@*/ ;
-
-static void EndCommentChars (void) /*@modifies nextToken@*/ ;
-static void IdChars (void) /*@modifies nextToken@*/ ;
-static void OpChars (void) /*@modifies nextToken@*/ ;
-static void ExtensionChar (void) /*@modifies nextToken@*/ ;
-static void SingChars (void) /*@modifies nextToken@*/ ;
-static void WhiteChars (void) /*@modifies nextToken@*/ ;
-static void EndCommentChar (void) /*@modifies nextToken@*/ ;
-static void IdChar (void) /*@modifies nextToken@*/ ;
-static void OpChar (void) /*@modifies nextToken@*/ ;
-static void SingChar (void) /*@modifies nextToken@*/ ;
-static void WhiteChar (void) /*@modifies nextToken@*/ ;
-
-static void TokenClass (void) /*@modifies nextToken@*/ ;
-static void QuantifierSymToks (void) /*@modifies nextToken@*/ ;
-static void LogicalOpToks (void) /*@modifies nextToken@*/ ;
-static void EqOpToks (void) /*@modifies nextToken@*/ ;
-static void EquationSymToks (void) /*@modifies nextToken@*/ ;
-static void EqSepSymToks (void) /*@modifies nextToken@*/ ;
-static void SelectSymToks (void) /*@modifies nextToken@*/ ;
-static void OpenSymToks (void) /*@modifies nextToken@*/ ;
-static void SepSymToks (void) /*@modifies nextToken@*/ ;
-static void CloseSymToks (void) /*@modifies nextToken@*/ ;
-static void SimpleIdToks (void) /*@modifies nextToken@*/ ;
-static void MapSymToks (void) /*@modifies nextToken@*/ ;
-static void MarkerSymToks (void) /*@modifies nextToken@*/ ;
-static void CommentSymToks (void) /*@modifies nextToken@*/ ;
-static void QuantifierSymTok (void) /*@modifies nextToken@*/ ;
-static void LogicalOpTok (void) /*@modifies nextToken@*/ ;
-static void EqOpTok (void) /*@modifies nextToken@*/ ;
-static void EquationSymTok (void) /*@modifies nextToken@*/ ;
-static void EqSepSymTok (void) /*@modifies nextToken@*/ ;
-static void SelectSymTok (void) /*@modifies nextToken@*/ ;
-static void OpenSymTok (void) /*@modifies nextToken@*/ ;
-static void SepSymTok (void) /*@modifies nextToken@*/ ;
-static void CloseSymTok (void) /*@modifies nextToken@*/ ;
-static void SimpleIdTok (void) /*@modifies nextToken@*/ ;
-static void MapSymTok (void) /*@modifies nextToken@*/ ;
-static void MarkerSymTok (void) /*@modifies nextToken@*/ ;
-static void CommentSymTok (void) /*@modifies nextToken@*/ ;
-static void SynClass (void) /*@modifies nextToken@*/ ;
-static void OldToken (void) /*@modifies nextToken@*/ ;
-static void NewToken (void) /*@modifies nextToken@*/ ;
-static void Token (void) /*@modifies nextToken@*/ ;
-
-static void InitReduce (LSLInitRuleCode p_rule) /*@modifies nextToken@*/ ;
-static void UpdateXCharKeywords (charCode) /*@modifies nextToken@*/ ;
-static void ProcessExtensionChar (void) /*@modifies nextToken@*/ ;
-static void ProcessEndCommentChar (void) /*@modifies nextToken@*/ ;
-static void ProcessSingleChar (charCode p_code) /*@modifies nextToken@*/ ;
-static void ProcessToken (ltokenCode p_code) /*@modifies nextToken@*/ ;
-static void ProcessSynonym (void) /*@modifies nextToken@*/ ;
-
-/* If TRUE character has been redefined as a singleChar. */
-static bool defineSingleChar[LASTCHAR + 1];
-
-static charCode currentExtensionChar;
-
-/* LSL init file keyword tokens.  */
-
-static /*@dependent@*/ ltoken endCommentCharToken;
-static /*@dependent@*/ ltoken idCharToken;
-static /*@dependent@*/ ltoken opCharToken;
-static /*@dependent@*/ ltoken extensionCharToken;
-static /*@dependent@*/ ltoken singleCharToken;
-static /*@dependent@*/ ltoken whiteCharToken;
-static /*@dependent@*/ ltoken quantifierSymToken;
-static /*@dependent@*/ ltoken logicalOpToken;
-static /*@dependent@*/ ltoken eqOpToken;
-static /*@dependent@*/ ltoken equationSymToken;
-static /*@dependent@*/ ltoken eqSepSymToken;
-static /*@dependent@*/ ltoken selectSymToken;
-static /*@dependent@*/ ltoken openSymToken;
-static /*@dependent@*/ ltoken sepSymToken;
-static /*@dependent@*/ ltoken closeSymToken;
-static /*@dependent@*/ ltoken simpleIdToken;
-static /*@dependent@*/ ltoken mapSymToken;
-static /*@dependent@*/ ltoken markerSymToken;
-static /*@dependent@*/ ltoken commentSymToken;
-static /*@dependent@*/ ltoken synonymToken;
-
-static bool
-hasFirstChar (ltoken tok)
-{
-  return (ltoken_isChar (tok)
-         && lscanCharClass (cstring_firstChar (ltoken_unparse (tok))) == SINGLECHAR);
-}
-
-void
-LSLProcessInitFile (void)
-{
-  InitFile ();
-}
-
-/*
-**
-**  Parsing functions for init file processing, in the same order as the
-**  grammar file lslinit.cfg.  This is top-down order, as much as possible.
-**
-*/
-
-static void
-InitFile (void)
-{
-  InitLines ();
-  InitReduce (INITFILE1);
-
-  if (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      LocalUserError (nextToken, "unexpected tokens after end-of-file");
-    }
-}
-
-static void
-InitLines (void)
-{
-  InitReduce (INITLINES1);
-
-  if (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      InitLine ();
-      InitReduce (INITLINES2);
-    }
-
-  while (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      InitLine ();
-      InitReduce (INITLINES3);
-    }
-
-}
-
-static void
-InitLine (void)
-{
-  if (ltoken_getCode (nextToken) == LST_EOL)
-    {
-     /* Nothing on line. */
-      InitReduce (INITLINE1);
-    }
-  else
-    {
-      Classification ();
-      InitReduce (INITLINE2);
-    }
-
-  if (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      LocalUserError (nextToken, "Unexpected tokens on line");
-    }
-
-  ltoken_free (nextToken);
-  nextToken = LSLScanNextToken ();            
-}
-
-static void
-Classification (void)
-{
-  if (ltoken_getRawText (nextToken) == ltoken_getText (endCommentCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (idCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (opCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (extensionCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (singleCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (whiteCharToken))
-    {
-      CharClass ();
-      InitReduce (CLASSIFICATION1);
-    }
-  else if (ltoken_getRawText (nextToken) == ltoken_getText (quantifierSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (logicalOpToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (eqOpToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (equationSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (eqSepSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (selectSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (openSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (sepSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (closeSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (simpleIdToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (mapSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (markerSymToken)
-          || ltoken_getRawText (nextToken) == ltoken_getText (commentSymToken))
-    {
-      TokenClass ();
-      InitReduce (CLASSIFICATION2);
-    }
-  else if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
-    {
-      SynClass ();
-      InitReduce (CLASSIFICATION3);
-    }
-  else
-    {
-      LocalUserError (nextToken,
-                     "expected character, token, or synonym classification");
-    }
-}
-
-static void
-CharClass (void)
-{
-  ltoken charClassToken;
-
-  charClassToken = nextToken;
-
-  nextToken = LSLScanNextToken ();             /* Discard char class keyword. */
-
-  if (ltoken_getRawText (charClassToken) == ltoken_getText (endCommentCharToken))
-    {
-      EndCommentChars ();
-      InitReduce (CHARCLASS1);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (idCharToken))
-    {
-      IdChars ();
-      InitReduce (CHARCLASS2);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (opCharToken))
-    {
-      OpChars ();
-      InitReduce (CHARCLASS3);
-    }
-  else if (ltoken_getRawText (charClassToken)
-          == ltoken_getText (extensionCharToken))
-    {
-      ExtensionChar ();
-      InitReduce (CHARCLASS4);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (singleCharToken))
-    {
-      SingChars ();
-      InitReduce (CHARCLASS5);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (whiteCharToken))
-    {
-      WhiteChars ();
-      InitReduce (CHARCLASS6);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected character classification");
-    }
-
-  ltoken_free (charClassToken);
-}
-
-static void
-EndCommentChars (void)
-{
-  EndCommentChar ();
-  InitReduce (LRC_ENDCOMMENT1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EndCommentChar ();
-      InitReduce (LRC_ENDCOMMENT2);
-    }
-
-}
-
-static void
-IdChars (void)
-{
-  IdChar ();
-  InitReduce (IDCHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      IdChar ();
-      InitReduce (IDCHARS2);
-    }
-}
-
-static void
-OpChars (void)
-{
-  OpChar ();
-  InitReduce (OPCHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      OpChar ();
-      InitReduce (OPCHARS2);
-    }
-}
-
-static void
-ExtensionChar (void)
-{
-  if (ltoken_isChar (nextToken)
-      && lscanCharClass (cstring_firstChar (ltoken_unparse (nextToken))) == SINGLECHAR)
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (LRC_EXTENSIONCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected only one character");
-    }
-}
-
-static void
-SingChars (void)
-{
-  SingChar ();
-  InitReduce (SINGCHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SingChar ();
-      InitReduce (SINGCHARS2);
-    }
-}
-
-static void
-WhiteChars (void)
-{
-  WhiteChar ();
-  InitReduce (WHITECHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      WhiteChar ();
-      InitReduce (WHITECHARS2);
-    }
-}
-
-static void
-EndCommentChar (void)
-{
-  if (ltoken_isChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (LRC_ENDCOMMENTCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected only one character");
-    }
-}
-
-static void
-IdChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (IDCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-OpChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (OPCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-SingChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (SINGCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-WhiteChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (WHITECHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-TokenClass (void)
-{
-  ltoken tokenClassToken;
-
-  tokenClassToken = nextToken;
-
-  nextToken = LSLScanNextToken ();
-
-  if (ltoken_getRawText (tokenClassToken) == ltoken_getText (quantifierSymToken))
-    {
-      QuantifierSymToks ();
-      InitReduce (TOKENCLASS1);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (logicalOpToken))
-    {
-      LogicalOpToks ();
-      InitReduce (TOKENCLASS2);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (eqOpToken))
-    {
-      EqOpToks ();
-      InitReduce (TOKENCLASS3);
-    }
-  else if (ltoken_getRawText (tokenClassToken)
-          == ltoken_getText (equationSymToken))
-    {
-      EquationSymToks ();
-      InitReduce (TOKENCLASS4);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (eqSepSymToken))
-    {
-      EqSepSymToks ();
-      InitReduce (TOKENCLASS5);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (selectSymToken))
-    {
-      SelectSymToks ();
-      InitReduce (TOKENCLASS6);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (openSymToken))
-    {
-      OpenSymToks ();
-      InitReduce (TOKENCLASS7);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (sepSymToken))
-    {
-      SepSymToks ();
-      InitReduce (TOKENCLASS8);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (closeSymToken))
-    {
-      CloseSymToks ();
-      InitReduce (TOKENCLASS9);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (simpleIdToken))
-    {
-      SimpleIdToks ();
-      InitReduce (TOKENCLASS10);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (mapSymToken))
-    {
-      MapSymToks ();
-      InitReduce (TOKENCLASS11);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (markerSymToken))
-    {
-      MarkerSymToks ();
-      InitReduce (TOKENCLASS12);
-    }
-  else if (ltoken_getRawText (tokenClassToken)
-          == ltoken_getText (commentSymToken))
-    {
-      CommentSymToks ();
-      InitReduce (TOKENCLASS13);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected token classification");
-    }
-
-  ltoken_free (tokenClassToken);
-}
-
-static void
-QuantifierSymToks (void)
-{
-  QuantifierSymTok ();
-  InitReduce (QUANTIFIERSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      QuantifierSymTok ();
-      InitReduce (QUANTIFIERSYMTOKS2);
-    }
-}
-
-static void
-LogicalOpToks (void)
-{
-  LogicalOpTok ();
-  InitReduce (LOGICALOPTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      LogicalOpTok ();
-      InitReduce (LOGICALOPTOKS2);
-    }
-}
-
-static void
-EqOpToks (void)
-{
-  EqOpTok ();
-  InitReduce (LRC_EQOPTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EqOpTok ();
-      InitReduce (LRC_EQOPTOKS2);
-    }
-}
-
-static void
-EquationSymToks (void)
-{
-  EquationSymTok ();
-  InitReduce (LRC_EQUATIONSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EquationSymTok ();
-      InitReduce (LRC_EQUATIONSYMTOKS2);
-    }
-}
-
-static void
-EqSepSymToks (void)
-{
-  EqSepSymTok ();
-  InitReduce (LRC_EQSEPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EqSepSymTok ();
-      InitReduce (LRC_EQSEPSYMTOKS2);
-    }
-}
-
-static void
-SelectSymToks (void)
-{
-  SelectSymTok ();
-  InitReduce (SELECTSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SelectSymTok ();
-      InitReduce (SELECTSYMTOKS2);
-    }
-}
-
-static void
-OpenSymToks (void)
-{
-  OpenSymTok ();
-  InitReduce (OPENSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      OpenSymTok ();
-      InitReduce (OPENSYMTOKS2);
-    }
-}
-
-static void
-SepSymToks (void)
-{
-  SepSymTok ();
-  InitReduce (SEPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SepSymTok ();
-      InitReduce (SEPSYMTOKS2);
-    }
-}
-
-static void
-CloseSymToks (void)
-{
-  CloseSymTok ();
-  InitReduce (CLOSESYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      CloseSymTok ();
-      InitReduce (CLOSESYMTOKS2);
-    }
-}
-
-static void
-SimpleIdToks (void)
-{
-  SimpleIdTok ();
-  InitReduce (SIMPLEIDTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SimpleIdTok ();
-      InitReduce (SIMPLEIDTOKS2);
-    }
-}
-
-static void
-MapSymToks (void)
-{
-  MapSymTok ();
-  InitReduce (MAPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      MapSymTok ();
-      InitReduce (MAPSYMTOKS2);
-    }
-}
-
-static void
-MarkerSymToks (void)
-{
-  MarkerSymTok ();
-  InitReduce (MARKERSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      MarkerSymTok ();
-      InitReduce (MARKERSYMTOKS2);
-    }
-}
-
-static void
-CommentSymToks (void)
-{
-  CommentSymTok ();
-  InitReduce (COMMENTSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      CommentSymTok ();
-      InitReduce (COMMENTSYMTOKS2);
-    }
-}
-
-static void
-QuantifierSymTok (void)
-{
-  Token ();
-  InitReduce (QUANTIFIERSYMTOK1);
-}
-
-static void
-LogicalOpTok (void)
-{
-  Token ();
-  InitReduce (LOGICALOPTOK1);
-}
-
-static void
-EqOpTok (void)
-{
-  Token ();
-  InitReduce (LRC_EQOPTOK1);
-}
-
-static void
-EquationSymTok (void)
-{
- /* ### EquationSymTok (); ### */
-  Token ();
-  InitReduce (LRC_EQUATIONSYMTOK1);
-}
-
-static void
-EqSepSymTok (void)
-{
-  Token ();
-  InitReduce (LRC_EQSEPSYMTOK1);
-
-}
-
-static void
-SelectSymTok (void)
-{
-  Token ();
-  InitReduce (SELECTSYMTOK1);
-}
-
-static void
-OpenSymTok (void)
-{
-  Token ();
-  InitReduce (OPENSYMTOK1);
-}
-
-static void
-SepSymTok (void)
-{
-  Token ();
-  InitReduce (SEPSYMTOK1);
-}
-
-static void
-CloseSymTok (void)
-{
-  Token ();
-  InitReduce (CLOSESYMTOK1);
-}
-
-static void
-SimpleIdTok (void)
-{
-  Token ();
-  InitReduce (SIMPLEIDTOK1);
-}
-
-static void
-MapSymTok (void)
-{
-  Token ();
-  InitReduce (MAPSYMTOK1);
-}
-
-static void
-MarkerSymTok (void)
-{
-  Token ();
-  InitReduce (MARKERSYMTOK1);
-
-}
-
-static void
-CommentSymTok (void)
-{
-  Token ();
-  InitReduce (COMMENTSYMTOK1);
-}
-
-
-static void
-SynClass (void)
-{
-  if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
-    {
-      ltoken_free (nextToken);
-      nextToken = LSLScanNextToken ();
-
-      OldToken ();
-      NewToken ();
-
-      InitReduce (SYNCLASS1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected synonym classification");
-    }
-
-}
-
-static void
-OldToken (void)
-{
-  Token ();
-  InitReduce (OLDTOKEN1);
-
-}
-
-static void
-NewToken (void)
-{
-  Token ();
-  InitReduce (NEWTOKEN1);
-
-}
-
-static void
-Token (void)
-{
-  if (ltoken_getCode (nextToken) == LST_EOL
-      || ltoken_getCode (nextToken) == LEOFTOKEN)
-    {
-      LocalUserError (nextToken, "unexpected end-of-line or end-of-file");
-    }
-  else
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-    }
-}
-
-/*
-** Init File Processing Routines, these routines use the shift-reduce sequence
-** produced by the init file parser and update the necessary tables for the
-** scanner.
-**
-** The same shift stack is used that LSL parser uses.  A different reduce
-** procedure is used because the init file grammar is different from the LSL
-** grammar.
-**
-*/
-
-static void
-InitReduce (LSLInitRuleCode rule)
-{
-  switch (rule)
-    {
-      case INITFILE1:
-      LTRACE ("INITFILE1");
-      break;
-
-    case INITLINES1:
-      LTRACE ("INITLINES1");
-      break;
-
-    case INITLINES2:
-      LTRACE ("INITLINES2");
-      break;
-
-    case INITLINES3:
-      LTRACE ("INITLINES3");
-      break;
-
-    case INITLINE1:
-      LTRACE ("INITLINE1");
-      break;
-
-    case INITLINE2:
-      LTRACE ("INITLINE2");
-      break;
-
-    case CLASSIFICATION1:
-      LTRACE ("CLASSIFICATION1");
-      break;
-
-    case CLASSIFICATION2:
-      LTRACE ("CLASSIFICATION2");
-      break;
-
-    case CLASSIFICATION3:
-      LTRACE ("CLASSIFICATION3");
-      break;
-
-    case CHARCLASS1:
-      LTRACE ("CHARCLASS1");
-      break;
-
-    case CHARCLASS2:
-      LTRACE ("CHARCLASS2");
-      break;
-
-    case CHARCLASS3:
-      LTRACE ("CHARCLASS3");
-      break;
-
-    case CHARCLASS4:
-      LTRACE ("CHARCLASS4");
-      break;
-
-    case CHARCLASS5:
-      LTRACE ("CHARCLASS5");
-      break;
-
-    case CHARCLASS6:
-      LTRACE ("CHARCLASS6");
-      break;
-
-    case LRC_ENDCOMMENT1:
-      LTRACE ("LRC_ENDCOMMENT1");
-      break;
-
-    case LRC_ENDCOMMENT2:
-      LTRACE ("LRC_ENDCOMMENT2");
-      break;
-
-    case IDCHARS1:
-      LTRACE ("IDCHARS1");
-      break;
-
-    case IDCHARS2:
-      LTRACE ("IDCHARS2");
-      break;
-
-    case OPCHARS1:
-      LTRACE ("OPCHARS1");
-      break;
-
-    case OPCHARS2:
-      LTRACE ("OPCHARS2");
-      break;
-
-    case LRC_EXTENSIONCHAR1:
-      LTRACE ("LRC_EXTENSIONCHAR1");
-      ProcessExtensionChar ();
-      break;
-
-    case SINGCHARS1:
-      LTRACE ("SINGCHARS1");
-      break;
-
-    case SINGCHARS2:
-      LTRACE ("SINGCHARS2");
-      break;
-
-    case WHITECHARS1:
-      LTRACE ("WHITECHARS1");
-      break;
-
-    case WHITECHARS2:
-      LTRACE ("WHITECHARS2");
-      break;
-
-    case LRC_ENDCOMMENTCHAR1:
-      LTRACE ("LRC_ENDCOMMENTCHAR1");
-      ProcessEndCommentChar ();
-      break;
-
-    case IDCHAR1:
-      LTRACE ("IDCHAR1");
-      ProcessSingleChar (IDCHAR);
-      break;
-
-    case OPCHAR1:
-      LTRACE ("OPCHAR1");
-      ProcessSingleChar (OPCHAR);
-      break;
-
-    case SINGCHAR1:
-      LTRACE ("SINGCHAR1");
-      ProcessSingleChar (SINGLECHAR);
-      break;
-
-    case WHITECHAR1:
-      LTRACE ("CHAR1");
-      ProcessSingleChar (WHITECHAR);
-      break;
-
-    case TOKENCLASS1:
-      LTRACE ("TOKENCLASS1");
-      break;
-
-    case TOKENCLASS2:
-      LTRACE ("TOKENCLASS2");
-      break;
-
-    case TOKENCLASS3:
-      LTRACE ("TOKENCLASS3");
-      break;
-
-    case TOKENCLASS4:
-      LTRACE ("TOKENCLASS4");
-      break;
-
-    case TOKENCLASS5:
-      LTRACE ("TOKENCLASS5");
-      break;
-
-    case TOKENCLASS6:
-      LTRACE ("TOKENCLASS6");
-      break;
-
-    case TOKENCLASS7:
-      LTRACE ("TOKENCLASS7");
-      break;
-
-    case TOKENCLASS8:
-      LTRACE ("TOKENCLASS8");
-      break;
-
-    case TOKENCLASS9:
-      LTRACE ("TOKENCLASS9");
-      break;
-
-    case TOKENCLASS10:
-      LTRACE ("TOKENCLASS10");
-      break;
-
-    case TOKENCLASS11:
-      LTRACE ("TOKENCLASS11");
-      break;
-
-    case TOKENCLASS12:
-      LTRACE ("TOKENCLASS12");
-      break;
-
-    case TOKENCLASS13:
-      LTRACE ("TOKENCLASS13");
-      break;
-
-    case QUANTIFIERSYMTOKS1:
-      LTRACE ("QUALIFERSYMTOKS1");
-      break;
-
-    case QUANTIFIERSYMTOKS2:
-      LTRACE ("QUANTIFIERSYMTOKS2");
-      break;
-
-    case LOGICALOPTOKS1:
-      LTRACE ("LOGICALOPTOKS1");
-      break;
-
-    case LOGICALOPTOKS2:
-      LTRACE ("LOGICALOPTOKS2");
-      break;
-
-    case LRC_EQOPTOKS1:
-      LTRACE ("LRC_EQOPTOKS1");
-      break;
-
-    case LRC_EQOPTOKS2:
-      LTRACE ("LRC_EQOPTOKS2");
-      break;
-
-    case LRC_EQUATIONSYMTOKS1:
-      LTRACE ("LRC_EQUATIONSYMTOKS1");
-      break;
-
-    case LRC_EQUATIONSYMTOKS2:
-      LTRACE ("LRC_EQUATIONSYMTOKS2");
-      break;
-
-    case LRC_EQSEPSYMTOKS1:
-      LTRACE ("LRC_EQSEPSYMTOKS1");
-      break;
-
-    case LRC_EQSEPSYMTOKS2:
-      LTRACE ("LRC_EQSEPSYMTOKS2");
-      break;
-
-    case SELECTSYMTOKS1:
-      LTRACE ("SELECTSYMTOKS1");
-      break;
-
-    case SELECTSYMTOKS2:
-      LTRACE ("SELECTSYMTOKS2");
-      break;
-
-    case OPENSYMTOKS1:
-      LTRACE ("OPENSYMTOKS1");
-      break;
-
-    case OPENSYMTOKS2:
-      LTRACE ("OPENSYMTOKS2");
-      break;
-
-    case SEPSYMTOKS1:
-      LTRACE ("SEPSYMTOKS1");
-      break;
-
-    case SEPSYMTOKS2:
-      LTRACE ("SEPSYMTOKS2");
-      break;
-
-    case CLOSESYMTOKS1:
-      LTRACE ("CLOSESYMTOKS1");
-      break;
-
-    case CLOSESYMTOKS2:
-      LTRACE ("CLOSESYMTOKS2");
-      break;
-
-    case SIMPLEIDTOKS1:
-      LTRACE ("SIMPLEIDTOKS1");
-      break;
-
-    case SIMPLEIDTOKS2:
-      LTRACE ("SIMPLEIDTOKS2");
-      break;
-
-    case MAPSYMTOKS1:
-      LTRACE ("MAPSYMTOKS1");
-      break;
-
-    case MAPSYMTOKS2:
-      LTRACE ("MAPSYMTOKS2");
-      break;
-
-    case MARKERSYMTOKS1:
-      LTRACE ("MARKERSYMTOKS1");
-      break;
-
-    case MARKERSYMTOKS2:
-      LTRACE ("MARKERSYMTOKS2");
-      break;
-
-    case COMMENTSYMTOKS1:
-      LTRACE ("COMMENTSYMTOKS1");
-      break;
-
-    case COMMENTSYMTOKS2:
-      LTRACE ("COMMENTSYMTOKS2");
-      break;
-
-    case QUANTIFIERSYMTOK1:
-      LTRACE ("QUANTIFERSYMTOK1");
-      ProcessToken (LST_QUANTIFIERSYM);
-      break;
-
-    case LOGICALOPTOK1:
-      LTRACE ("LOGICALOPTOK1");
-      ProcessToken (LST_LOGICALOP);
-      break;
-
-    case LRC_EQOPTOK1:
-      LTRACE ("LRC_EQOPTOK1");
-      ProcessToken (LST_EQOP);
-      break;
-
-    case LRC_EQUATIONSYMTOK1:
-      LTRACE ("LRC_EQUATIONSYMTOK1");
-      ProcessToken (LST_EQUATIONSYM);
-      break;
-
-    case LRC_EQSEPSYMTOK1:
-      LTRACE ("LRC_EQSEPSYMTOK1");
-      ProcessToken (LST_EQSEPSYM);
-      break;
-
-    case SELECTSYMTOK1:
-      LTRACE ("SELECTSYMTOK1");
-      ProcessToken (LST_SELECTSYM);
-      break;
-
-    case OPENSYMTOK1:
-      LTRACE ("OPENSYMTOK1");
-      ProcessToken (LST_OPENSYM);
-      break;
-
-    case SEPSYMTOK1:
-      LTRACE ("SEPSYMTOK1");
-      ProcessToken (LST_SEPSYM);
-      break;
-
-    case CLOSESYMTOK1:
-      LTRACE ("CLOSESYMTOK1");
-      ProcessToken (LST_CLOSESYM);
-      break;
-
-    case SIMPLEIDTOK1:
-      LTRACE ("SIMPLEIDTOK1");
-      ProcessToken (LST_SIMPLEID);
-      break;
-
-    case MAPSYMTOK1:
-      LTRACE ("MAPSYMTOK1");
-      ProcessToken (LST_MAPSYM);
-      break;
-
-    case MARKERSYMTOK1:
-      LTRACE ("MARKERSYMTOK1");
-      ProcessToken (LST_MARKERSYM);
-      break;
-
-    case COMMENTSYMTOK1:
-      LTRACE ("COMMENTSYMTOK1");
-      ProcessToken (LST_COMMENTSYM);
-      break;
-
-    case SYNCLASS1:
-      LTRACE ("SYNCLASS1");
-      ProcessSynonym ();
-      break;
-
-    case OLDTOKEN1:
-      LTRACE ("OLDTOKEN1");
-      break;
-
-    case NEWTOKEN1:
-      LTRACE ("NEWTOKEN1");
-      break;
-
-    default:
-      llcontbuglit ("InitReduce: bad switch");
-      break;
-
-    }                          /* end switch       */
-}                              /* end InitReduce () */
-
-
-
-/* Reset the first character of the predefined extensionChar keywords when  */
-/* the extensionChar changes.  e.g. "extensionChar @" changes "forall" to   */
-/* "@forall".                                                              */
-
-static void
-UpdateXCharKeywords (charCode xCharCode)
-{
-  char xChar = (char) xCharCode;
-  char *str;
-
-  str = ltoken_getTextChars (ltoken_forall);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_and);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_or);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_implies);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_eq);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_neq);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_equals);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_eqsep);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_select);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_open);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_sep);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_close);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_id);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_arrow);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_marker);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_comment);
-  *str = xChar;
-
-}
-
-/* Different from ProcessCharClass because only allow one extension        */
-/* character. Therefore, the present extension character must be set to a   */
-/* singleChar.                                                             */
-
-static void
-ProcessExtensionChar (void)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (!defineSingleChar[(int)firstChar]
-      && lscanCharClass (firstChar) == SINGLECHAR)
-    {
-     /* Is a single character that has not been defined before.            */
-     /* Can only have one extension char.  Release old one. */
-      lsetCharClass (firstChar, CHC_EXTENSION);
-      
-      /* this is a (bogus) type bug! caught by splint */
-      /* lsetCharClass (currentExtensionChar, SINGLECHAR); */
-
-      lsetCharClass ((char) currentExtensionChar, SINGLECHAR);
-
-      currentExtensionChar = (charCode) firstChar;
-      UpdateXCharKeywords (currentExtensionChar);
-    }
-  else
-    {
-     /* Already redefined.  Don't allow to be redefined. */
-      LocalUserError (stackToken, "character is already defined, cannot redefine");
-    }
-  ltoken_free (stackToken);
-}
-
-/* Different from ProcessSingleChar because allow any characters to be     */
-/* endCommentChar and also set a different part of the scanner structure.   */
-
-static void
-ProcessEndCommentChar (void)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (LSLIsEndComment (firstChar))
-    {
-      LocalUserError (stackToken,
-                   "already defined as a endCommentChar, cannot redefine");
-    }
-  else
-    {
-      lsetEndCommentChar (firstChar, TRUE);
-    }
-  ltoken_free (stackToken);
-}
-
-static void
-ProcessSingleChar (charCode code)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (!defineSingleChar[(int)firstChar]
-      && lscanCharClass (firstChar) == SINGLECHAR)
-    {
-      /* Is a single character that has not been defined before.           */
-      /* It's OK to redefine once. */
-      lsetCharClass (firstChar, code);
-      /* OK to mark as a defined singleChar even if not.  Only check       */
-      /* defineSingleChar[] if defining a singleChar.                      */
-      defineSingleChar[(int)firstChar] = TRUE;
-    }
-  else
-    {
-      LocalUserError (stackToken, "character is already defined, cannot redefine");
-    }
-  ltoken_free (stackToken);
-}
-
-static void
-ProcessToken (ltokenCode code)
-{
-  ltoken stackToken, temp;
-  lsymbol sym;
-
-  stackToken = LSLGenTopPopShiftStack ();
-  sym = ltoken_getText (stackToken);
-
-  if (LSLIsSyn (sym))
-    {
-      LocalUserError (stackToken,
-                     "already defined as a synonym, cannot redefine");
-    }
-
-  /* Get the token from the token table, so can check if the token    */
-  /* was updated by a previous token.                              */
-  temp = LSLGetToken (sym);
-  
-  if (ltoken_isStateDefined (temp))
-    {
-      if ((code == LST_OPENSYM && sym == lsymbol_fromChars ("[")) ||
-         (code == LST_CLOSESYM && sym == lsymbol_fromChars ("]")))
-       {
-         /* ignore "openSym [" and "closeSym ]" TokenClass */
-         ltoken_free (stackToken);
-         return;
-       }
-      else
-       {
-         LocalUserError (stackToken, "already defined, cannot redefine");
-         PrintToken (temp);
-       }
-    }
-  
-  LSLUpdateToken (code, ltoken_getText (stackToken), TRUE);
-  ltoken_free (stackToken);
-}
-
-
-static void
-ProcessSynonym (void)
-{
-  ltoken newtok;
-  ltoken oldtok;
-
-  newtok = LSLGenTopPopShiftStack ();
-  oldtok = LSLGenTopPopShiftStack ();
-
-  if (ltoken_wasSyn (newtok))
-    {
-     /* The token has a synonym.  This means that the synonym was in the */
-     /* init file, so complain about redefining as a synonym again         */
-      LocalUserError (newtok, "newtok already is a synonym, cannot redefine");
-    }
-
-  if (ltoken_hasSyn (newtok))
-    {
-      /*
-      ** newtok already has a synonym defined for it.  Do not allow        
-      ** synonyms to be chained.                                           
-      */
-
-      LocalUserError (newtok,
-                     "newtok already has a synonym, cannot chain synonyms");
-    }
-
-  if (ltoken_isStateDefined (newtok))
-    {
-      LocalUserError (newtok, "newtok already defined, cannot redefine");
-    }
-
-  LSLAddSyn (ltoken_getText (newtok), ltoken_getText (oldtok));
-  ltoken_free (oldtok);
-  ltoken_free (newtok);
-}
-
-
-/*
- * Utilities, in alphabetical order
- */
-
-static void
-LocalUserError (ltoken t, /*@temp@*/ char *msg)
-{
-  lldiagmsg (message ("%s %s in the LSL init file:", 
-                     ltoken_unparse (t), cstring_fromChars (msg)));
-
-  ltoken_free (nextToken);
-  nextToken = LSLScanNextToken ();            
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      ltoken_free (nextToken);
-      nextToken = LSLScanNextToken ();
-    }
-}
-
-/*
-**  Required initialization and cleanup routines
-*/
-
-static /*@exposed@*/ ltoken insertSimpleToken (char *text) 
-  /*@modifies internalState@*/
-{
-  return (LSLInsertToken (LST_SIMPLEID, lsymbol_fromChars (text), 0, FALSE));
-}
-
-void
-LSLProcessInitFileInit (void)
-{
-  int i;
-
-  LSLGenInit (TRUE);           /* parsing LSLinit not LCLinit */
-
-  /*
-  ** Insert the init file keywords into the token table as undefined       
-  ** SIMPLEIDs.  They are defined as simpleIds since they must be treated 
-  ** that way if they do not appear as the first token on a line, and      
-  ** they must be treated that way for the actual LSL parsing. Save the   
-  ** tokens so can recognize as init file keywords when necessary.      
-  */
-
-  endCommentCharToken = insertSimpleToken ("endCommentChar");
-  idCharToken = insertSimpleToken ("idChar");                       
-  opCharToken = insertSimpleToken ("opChar");                       
-  extensionCharToken = insertSimpleToken ("extensionChar");    
-  singleCharToken = insertSimpleToken ("singleChar");  
-  whiteCharToken = insertSimpleToken ("whiteChar");
-
-  quantifierSymToken = insertSimpleToken ("quantifierSym");
-  logicalOpToken = insertSimpleToken ("logicalOp");
-  eqOpToken = insertSimpleToken ("eqOp");                         
-  equationSymToken = insertSimpleToken ("equationSym");
-  eqSepSymToken = insertSimpleToken ("eqSepSym");                             
-  selectSymToken = insertSimpleToken ("selectSym");
-  openSymToken = insertSimpleToken ("openSym");                              
-  sepSymToken = insertSimpleToken ("sepSym");                       
-  closeSymToken = insertSimpleToken ("closeSym");                             
-  simpleIdToken = insertSimpleToken ("simpleId");                             
-  mapSymToken = insertSimpleToken ("mapSym");                       
-  markerSymToken = insertSimpleToken ("markerSym");
-  commentSymToken = insertSimpleToken ("commentSym"); 
-  synonymToken = insertSimpleToken ("synonym");                              
-
-  for (i = 0; i <= LASTCHAR; i++)
-    {
-      defineSingleChar[i] = FALSE;
-    }
-  
-  /*
-  ** Record the current extension character so can redefine back to        
-  ** singleChar if a new extension character is redefined.                 
-  */
-
-  currentExtensionChar = (charCode) CHAREXTENDER;
-
-  LSLReportEolTokens (TRUE);
-  ltoken_free (nextToken);
-  nextToken = LSLScanNextToken ();            
-}
-
-
-
-
-
-
-
-
index 8ba1c6045d2bba2bc41246203b566420045a50ee..a78861f59e99b1ec91beff48015b79e7c918edfc 100644 (file)
--- a/src/osd.c
+++ b/src/osd.c
@@ -1033,6 +1033,7 @@ cstring osd_absolutePath (cstring cwd, cstring filename)
 
 cstring osd_outputPath (cstring filename)
 {
+  /*@i2534 fix this junky code once and for all! */
 # if defined (UNIX) || defined (OS2)
   char *rel_buffer;
   char *rel_buf_p;
@@ -1064,7 +1065,7 @@ cstring osd_outputPath (cstring filename)
       else
        {
          /*@i324 ! splint didn't report an errors for: return ++path_p; */
-         return cstring_fromCharsNew (++path_p);
+         return cstring_fromCharsNew (path_p + 1);
        }
     }
   else
@@ -1090,7 +1091,7 @@ cstring osd_outputPath (cstring filename)
 
       /* Find out how many directory levels in cwd were *not* matched.  */
       while (*cwd_p != '\0')
-       {
+       {s
          if (osd_isConnectChar (*cwd_p++))
            unmatched_slash_count++;
        }
@@ -1130,6 +1131,7 @@ cstring osd_outputPath (cstring filename)
         } /*@-usereleased@*/
       while ((*rel_buf_p++ = *path_p++) != '\0') ;
 
+      
       /*@=usereleased@*/ /*@i523! shouldn't need these */
       --rel_buf_p;
 
diff --git a/src/rcfiles.c b/src/rcfiles.c
new file mode 100644 (file)
index 0000000..b234c44
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2002 University of Virginia,
+**         Massachusetts Institute of Technology
+**
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2 of the License, or (at your
+** option) any later version.
+** 
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+** 
+** The GNU General Public License is available from http://www.gnu.org/ or
+** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+** MA 02111-1307, USA.
+**
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
+** For more information: http://www.splint.org
+*/
+/*
+** rcfiles.c
+*/
+
+# include "splintMacros.nf"
+# include "basic.h"
+# include "rcfiles.h"
+
+
+static void rcfiles_loadFile (FILE *p_rcfile, cstringSList *p_passThroughArgs)
+   /*@modifies *p_passThroughArgs, p_rcfile@*/
+   /*@ensures closed p_rcfile@*/ ;
+
+bool rcfiles_read (cstring fname, cstringSList *passThroughArgs, bool report)
+{
+  bool res = FALSE;
+
+  if (fileTable_exists (context_fileTable (), fname))
+    {
+      if (report)
+       {
+         voptgenerror
+           (FLG_WARNRC, 
+            message ("Multiple attempts to read options file: %s", fname),
+            g_currentloc);
+       }
+    }
+  else
+    {
+      FILE *innerf = fileTable_openReadFile (context_fileTable (), fname);
+      
+      if (innerf != NULL)
+       {
+         fileloc fc = g_currentloc;
+         g_currentloc = fileloc_createRc (fname);
+
+         displayScan (message ("< reading options from %q >", 
+                               fileloc_outputFilename (g_currentloc)));
+         
+         rcfiles_loadFile (innerf, passThroughArgs);
+         fileloc_reallyFree (g_currentloc);
+         g_currentloc = fc;
+         res = TRUE;
+       }
+      else 
+       {
+         if (report)
+           {
+             voptgenerror
+               (FLG_WARNRC, 
+                message ("Cannot open options file: %s", fname),
+                g_currentloc);
+           }
+       }
+    }
+
+  return res;
+}
+
+static void rcfiles_loadFile (/*:open:*/ FILE *rcfile, cstringSList *passThroughArgs)
+   /*@modifies rcfile@*/
+   /*@ensures closed rcfile@*/
+{
+  char *s = mstring_create (MAX_LINE_LENGTH);
+  char *os = s;
+  cstringList args = cstringList_new ();
+
+  DPRINTF (("Loading rc file..."));
+
+  s = os;
+
+  while (reader_readLine (rcfile, s, MAX_LINE_LENGTH) != NULL)
+    {
+      char c;
+
+      DPRINTF (("Line: %s", s));
+      DPRINTF (("args: %s", cstringList_unparse (args)));
+
+      while (*s == ' ' || *s == '\t')
+       {
+         s++;
+         incColumn ();
+       }
+      
+      while (*s != '\0')
+       {
+         char *thisflag;
+         bool escaped = FALSE;
+         bool quoted = FALSE;
+         c = *s;
+
+         /* comment characters */
+         if (c == '#' || c == ';' || c == '\n') 
+           {
+             /*@innerbreak@*/
+             break;
+           }
+         
+         thisflag = s;
+         
+         while ((c = *s) != '\0')
+           { /* remember to handle spaces and quotes in -D and -U ... */
+             if (escaped)
+               {
+                 escaped = FALSE;
+               }
+             else if (quoted)
+               {
+                 if (c == '\\')
+                   {
+                     escaped = TRUE;
+                   }
+                 else if (c == '\"')
+                   {
+                     quoted = FALSE;
+                   }
+                 else
+                   {
+                     ;
+                   }
+               }
+             else if (c == '\"')
+               {
+                 quoted = TRUE;
+               }
+             else
+               {
+                if (c == ' ' || c == '\t' || c == '\n')
+                  {
+                    /*@innerbreak@*/ break;
+                  }
+              }
+                 
+             s++; 
+             incColumn ();
+           }
+
+         DPRINTF (("Nulling: %c", *s));
+         *s = '\0';
+
+         if (mstring_isEmpty (thisflag))
+           {
+             llfatalerror (message ("Missing flag: %s",
+                                    cstring_fromChars (os)));
+           }
+         else
+           {
+             args = cstringList_add (args, cstring_fromCharsNew (thisflag));
+             DPRINTF (("args: %s", cstringList_unparse (args)));
+           }
+         
+         *s = c;
+         DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
+         
+         while ((c == ' ') || (c == '\t'))
+           {
+             c = *(++s);
+             incColumn ();
+           } 
+       }
+      
+      s = os;
+    }
+
+  sfree (os); 
+
+  DPRINTF (("args: %s", cstringList_unparse (args)));
+  flags_processFlags (FALSE, 
+                     fileIdList_undefined,
+                     fileIdList_undefined,
+                     fileIdList_undefined,
+                     fileIdList_undefined,
+                     passThroughArgs,
+                     cstringList_size (args),
+                     cstringList_getElements (args));
+  cstringList_free (args);
+  check (fileTable_closeFile (context_fileTable (), rcfile));
+}
+
+
+
index 5386fbfd23b64a8317c08b14e00ceb3785964998..d64ad4bda830d2900c442ad3a07039eaafdae5f6 100644 (file)
@@ -7311,9 +7311,10 @@ checkEnumConformance (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew)
       if (optgenerror 
          (FLG_MATCHFIELDS,
           message ("Enum %q declared with members { %q } but "
-                   "specified with members { %q }",
+                   "%s with members { %q }",
                    uentry_getName (old), 
                    enumNameList_unparse (enew),
+                   uentry_specOrDefName (old),
                    enumNameList_unparse (eold)),
           uentry_whereDeclared (unew)))
        {
index 099737a3754e22ce47b8b3633fe2c30adb09fdda..cc26ba8c53e161f5cbb6ff6b677ea87ff6235276 100644 (file)
@@ -891,7 +891,8 @@ usymtab_supEntryAux (/*@notnull@*/ usymtab st,
          if (!(st->lexlevel > fileScope || !sRef_modInFunction ()))
            {
              if (uentry_isDatatype (e) || uentry_isAnyTag (e)
-                 || uentry_isEnumConstant (e))
+                 || uentry_isEnumConstant (e)
+                 || uentry_isStatic (e)) /* bug fix from Brian St. Pierre */
                {
                  ; /* 
                     ** Not a bug.  Code like,
index e33bceb72dbf0c8635f600f30ddc59b295cf342b..7fc4721d630367a06394e0da18b05371e91970f9 100644 (file)
@@ -42,7 +42,7 @@ UNITTESTS = \
   abstptr abstract alias alttypes ansireserved argorder \
   args arraydims arrayinit arraylit blocks break cases cast charlit clauses commentchar compdestroy \
   compoundliterals compoundstmt constannot controldepth csyntax czechnames czechoslovaknames deadparam \
-  decl divzero enum exports external fields flags forbody format freearray \
+  decl divzero enum enumtag exports external fields flags forbody format freearray \
   funcpointer functionmacro glob globals impabstract info init inparam internal iter keep libs \
   linked lintcomments list loopexec looptesteffect \
   macros macrosef merge mergenull modifies modtest moduncon \
@@ -76,25 +76,25 @@ all check: fulltest
 
 .PHONY: version
 version:
-       -$(SPLINTP) -help version
+       -$(SPLINT) -help version
 
 .PHONY: help
 
 help:
        -@$(SPLINT)
        -@LARCH_PATH=/dev/null; $(SPLINT) -nof empty.lcl
-       -@$(SPLINTP) -help
+       -@$(SPLINT) -help
        -@$(SPLINTP) -asdf
        -@$(SPLINTP) +boolint +boolint 
-       -@$(SPLINTP) -help flags alpha
+       -@$(SPLINT) -help flags alpha
 
 
 #commenting these out for the release because they will almost always fail
 #since the default will only fit one system
 #Don't want to panic the user... 
-#      -@$(SPLINTP) -help flags all     | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
-#      -@$(SPLINTP) -help flags full    | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
-#      -@$(SPLINTP) -help flags manual     | $(GREP) -v "^larchpath <path> "   | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
+#      -@$(SPLINT) -help flags all     | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
+#      -@$(SPLINT) -help flags full    | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
+#      -@$(SPLINT) -help flags manual     | $(GREP) -v "^larchpath <path> "   | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
 
 #larch and lclimportdir have different hardcoded default paths so don't include the path in the output..
 
@@ -159,8 +159,8 @@ fulltest:
        @echo "Testing $(PACKAGE) $(VERSION)..."
        @echo
        @echo "Version Info:"
-       @$(SPLINTP) -help version
-       @$(SPLINTP) -help vars
+       @$(SPLINT) -help version
+       @$(SPLINT) -help vars
        @echo ""
        @echo "Tests:"
        @echo ""
@@ -370,6 +370,10 @@ enum:
        -$(SPLINTR) enum -expect 16
        -$(SPLINTR) enum -misscase -expect 14
 
+.PHONY: enumtag
+enumtag:
+       -$(SPLINTR) enumtag.c -expect 2
+
 .PHONY: exports
 exports:
        -$(SPLINTR) exports.c +exporttype +exportvar +exportfcn +topuse +typeuse -expect 6
@@ -1084,6 +1088,7 @@ EXTRA_DIST =  ./abst_t.lcl ./abst_t.lcs  \
               ./dkf5kSprintf.c \
               ./ensures.c \
               ./enum.c \
+              ./enumtag.c \
               ./exports.c \
               ./external.c \
               ./fields.c \
@@ -1379,6 +1384,7 @@ EXTRA_DIST =  ./abst_t.lcl ./abst_t.lcs  \
               deadparam.expect \
               decl.expect \
               enum.expect \
+              enumtag.expect \
               exports.expect \
               external.expect \
               fields.expect \
index 263863de02af26d458af2bf418ec10ae918f6ea2..64d934d213b4334a228fed94d670e3237ea5b2e5 100644 (file)
@@ -120,7 +120,7 @@ UNITTESTS = \
   abstptr abstract alias alttypes ansireserved argorder \
   args arraydims arrayinit arraylit blocks break cases cast charlit clauses commentchar compdestroy \
   compoundliterals compoundstmt constannot controldepth csyntax czechnames czechoslovaknames deadparam \
-  decl divzero enum exports external fields flags forbody format freearray \
+  decl divzero enum enumtag exports external fields flags forbody format freearray \
   funcpointer functionmacro glob globals impabstract info init inparam internal iter keep libs \
   linked lintcomments list loopexec looptesteffect \
   macros macrosef merge mergenull modifies modtest moduncon \
@@ -337,6 +337,7 @@ EXTRA_DIST = ./abst_t.lcl ./abst_t.lcs  \
               ./dkf5kSprintf.c \
               ./ensures.c \
               ./enum.c \
+              ./enumtag.c \
               ./exports.c \
               ./external.c \
               ./fields.c \
@@ -632,6 +633,7 @@ EXTRA_DIST = ./abst_t.lcl ./abst_t.lcs  \
               deadparam.expect \
               decl.expect \
               enum.expect \
+              enumtag.expect \
               exports.expect \
               external.expect \
               fields.expect \
@@ -926,24 +928,24 @@ all check: fulltest
 
 .PHONY: version
 version:
-       -$(SPLINTP) -help version
+       -$(SPLINT) -help version
 
 .PHONY: help
 
 help:
        -@$(SPLINT)
        -@LARCH_PATH=/dev/null; $(SPLINT) -nof empty.lcl
-       -@$(SPLINTP) -help
+       -@$(SPLINT) -help
        -@$(SPLINTP) -asdf
        -@$(SPLINTP) +boolint +boolint 
-       -@$(SPLINTP) -help flags alpha
+       -@$(SPLINT) -help flags alpha
 
 #commenting these out for the release because they will almost always fail
 #since the default will only fit one system
 #Don't want to panic the user... 
-#      -@$(SPLINTP) -help flags all     | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
-#      -@$(SPLINTP) -help flags full    | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
-#      -@$(SPLINTP) -help flags manual     | $(GREP) -v "^larchpath <path> "   | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
+#      -@$(SPLINT) -help flags all     | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
+#      -@$(SPLINT) -help flags full    | $(GREP) -v "^larchpath <path> "     | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
+#      -@$(SPLINT) -help flags manual     | $(GREP) -v "^larchpath <path> "   | $(GREP) -v "^lclimportdir <directory> " | $(GREP) -v "  Path argument.  Default: " |  $(GREP) -v "  Directory argument.  Default: " | $(GREP) -v "  lclimportdir <directory> "
 
 #larch and lclimportdir have different hardcoded default paths so don't include the path in the output..
 
@@ -980,8 +982,8 @@ fulltest:
        @echo "Testing $(PACKAGE) $(VERSION)..."
        @echo
        @echo "Version Info:"
-       @$(SPLINTP) -help version
-       @$(SPLINTP) -help vars
+       @$(SPLINT) -help version
+       @$(SPLINT) -help vars
        @echo ""
        @echo "Tests:"
        @echo ""
@@ -1191,6 +1193,10 @@ enum:
        -$(SPLINTR) enum -expect 16
        -$(SPLINTR) enum -misscase -expect 14
 
+.PHONY: enumtag
+enumtag:
+       -$(SPLINTR) enumtag.c -expect 2
+
 .PHONY: exports
 exports:
        -$(SPLINTR) exports.c +exporttype +exportvar +exportfcn +topuse +typeuse -expect 6
index 36ca6ffc9cd6b60e56d9c97c04786f9d7fd3a0d2..3ef45751e91b44ae0f56bd30bf73eba7f6d6c191 100644 (file)
@@ -25,9 +25,9 @@ clauses3.c:61:5: Storage x->x is released in one path, but live in another.
 
 Finished checking --- 2 code warnings, as expected
 
-Warning: selecting unix library.  Unix library is ad hoc addition to POSIX
-library.  Recommend use +posixlib to select POSIX library instead. Use
--warnunixlib to suppress this message.
+Command Line: Selecting unix library.  Unix library is ad hoc addition to POSIX
+    library.  Recommend use +posixlib to select POSIX library instead. Use
+    -warnunixlib to suppress this message.
 clauses3.c: (in function h)
 clauses3.c:48:5: Storage x->x is released in one path, but live in another.
    clauses3.c:46:10: Storage x->x is released
diff --git a/test/enumtag.c b/test/enumtag.c
new file mode 100644 (file)
index 0000000..6e89120
--- /dev/null
@@ -0,0 +1,37 @@
+typedef struct s_st st;
+
+struct s_st {
+  int x;
+} ;
+
+
+typedef enum e_tag tag;
+
+enum e_tag r;
+
+enum e_tag {
+  E_X, E_Y, E_Z
+} ;
+
+int f (tag e)
+{
+  if (e == E_X)
+    {
+      return 3;
+    }
+  else
+    {
+      enum e_tag h = E_Z;
+
+      if (h == e)
+       {
+         return 7;
+       }
+    }
+
+  return 12;
+}
+
+enum e_tag {
+  E_M
+} ;
diff --git a/test/enumtag.expect b/test/enumtag.expect
new file mode 100644 (file)
index 0000000..19860fb
--- /dev/null
@@ -0,0 +1,8 @@
+
+enumtag.c:35:6: Enum tag enum e_tag defined more than once
+   enumtag.c:12:6: Previous definition of enum e_tag
+enumtag.c:35:6: Enum enum e_tag declared with members { E_M } but previously
+                   declared with members { E_X, E_Y, E_Z }
+   enumtag.c:12:6: Declaration of enum e_tag
+
+Finished checking --- 2 code warnings, as expected
index 6d3dd7fa81a8a57ebaa4995999568125f828c6ff..c3403bfd638cf8485af36fa519336b2be6703cc3 100644 (file)
@@ -1,5 +1,5 @@
 
-Warning: setting +typeuse redundant with current value
+Command Line: Setting +typeuse redundant with current value
 exports.h:1:13: Type exported, but not specified: myint
 exports.h:3:12: Variable exported, but not specified: glob
 exports.h:5:12: Function exported, but not specified: f
index 7fe89bb314e949f3f8a68a357b8929b6c68fa643..b93e9c003c52b5ef2efb5bf7b658909156010c7c 100644 (file)
@@ -4,10 +4,9 @@ flags.c:5:9: Variable y
     initialized to type
     char, expects int:
     'c'
-flags.c:7:18: Warning:
-    Value for linelen
-    must be at least 20
-    (given 13)
+flags.c:7:18: Value for
+    linelen must be at
+    least 20 (given 13)
 flags.c:11:5:
     Internal identifier
     xx2 is not
index 3bd57c8c2e689e0f859dd914fdad76297cd65ef0..07a8fd99a092f2abc8c75ed15499ac903060773e 100644 (file)
@@ -11,24 +11,24 @@ rc.c:3:10: Return value type int does not match declared type char *: 12
 
 Finished checking --- 1 code warning, as expected
 
-rc2.splintrc:1:18: Warning: setting +boolint redundant with current value
+rc2.splintrc:1:18: Setting +boolint redundant with current value
 rc.c: (in function f)
 rc.c:3:10: Observer storage returned without qualification: "a silly\"flag\"\\"
    rc.c:3:10: Storage becomes observer
 
 Finished checking --- 1 code warning, as expected
 
-rc2.splintrc:1:18: Warning: setting +boolint redundant with current value
+rc2.splintrc:1:18: Setting +boolint redundant with current value
 rc.c: (in function f)
 rc.c:3:10: Unrecognized identifier: MYSTERY
 
 Finished checking --- 1 code warning, as expected
 
-rc3.splintrc:2:1: Bad flag syntax (+ or - expected, + is assumed):
-                                    internalnamelen    73
+rc3.splintrc:6:3: Flag dump must be followed by a string
   A flag is not recognized or used in an incorrect way (Use -badflag to inhibit
   warning)
-rc3.splintrc:5:24: Flag dump must be followed by an argument
+rc3.splintrc:6:3: Cannot list files in .splintrc files:
+                     internalnamelen, 73 (probable missing + or -)
 rc.c: (in function f)
 rc.c:3:10: Unrecognized identifier: MYSTERY
 
This page took 0.314867 seconds and 5 git commands to generate.