From: evans1629 Date: Tue, 19 Feb 2002 00:52:41 +0000 (+0000) Subject: Integrated Herbert Martin Dietze's changes for OS/2. X-Git-Tag: splint-3_1_0~145 X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/commitdiff_plain/7ac543fa1ffcb930d63a610110fa05949421f860 Integrated Herbert Martin Dietze's changes for OS/2. --- diff --git a/Makefile.in b/Makefile.in index b48371b..1ab931e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,10 +111,10 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive -DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ - acinclude.m4 aclocal.m4 config.hin config/config.guess \ - config/config.sub config/depcomp config/install-sh \ - config/missing config/mkinstalldirs configure configure.ac +DIST_COMMON = README ./stamp-h.in Makefile.am Makefile.in acinclude.m4 \ + aclocal.m4 config.hin config/config.guess config/config.sub \ + config/depcomp config/install-sh config/missing \ + config/mkinstalldirs configure configure.ac DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/configure b/configure index 1fe90aa..f230cb5 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52 for Splint 3.0.1.6. +# Generated by Autoconf 2.52 for Splint 3.0.1.7. # # Report bugs to . # @@ -149,8 +149,8 @@ mandir='${prefix}/man' # Identity of this package. PACKAGE_NAME='Splint' PACKAGE_TARNAME='splint' -PACKAGE_VERSION='3.0.1.6' -PACKAGE_STRING='Splint 3.0.1.6' +PACKAGE_VERSION='3.0.1.7' +PACKAGE_STRING='Splint 3.0.1.7' PACKAGE_BUGREPORT='splint-bug@splint.org' ac_prev= @@ -567,7 +567,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <&5 <>confdefs.h <>confdefs.h <>$CONFIG_STATUS <&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me (Splint 3.0.1.6) 2.52, executed with +This file was extended by $as_me (Splint 3.0.1.7) 2.52, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS diff --git a/configure.ac b/configure.ac index 5b4b8b3..40c2f20 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process with autoconf to create a configure script -*- Autoconf -*- AC_PREREQ(2.50) -AC_INIT([Splint], [3.0.1.6], [splint-bug@splint.org], [splint]) +AC_INIT([Splint], [3.0.1.7], [splint-bug@splint.org], [splint]) dnl This MUST precede any other macro AC_CONFIG_AUX_DIR([config]) diff --git a/src/Headers/splintMacros.nf b/src/Headers/splintMacros.nf index 200a06f..f441a1d 100644 --- a/src/Headers/splintMacros.nf +++ b/src/Headers/splintMacros.nf @@ -121,14 +121,12 @@ (void)printf arg; printf("\n"); /*@=formatconst@*/ /*@=mustfree@*/ /*@=null@*/ (void) fflush (stdout); \ } while (FALSE) +/* +** DPRINTF does nothing, just a marker to save TPRINTF's +*/ -# if DEBUGPRINT -/*@notfunction@*/ -# define DPRINTF(s) /*@access cstring@*/ TPRINTF(s) /*@noaccess cstring@*/ -# else /*@notfunction@*/ # define DPRINTF(s) -# endif /*@notfunction@*/ # define INTCOMPARERETURN(x,y) \ diff --git a/src/Makefile.in b/src/Makefile.in index 7cd206a..7f4070a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -581,7 +581,7 @@ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(lcl_SOURCES) $(splint_SOURCES) -DIST_COMMON = Makefile.am Makefile.in +DIST_COMMON = ChangeLog Makefile.am Makefile.in SOURCES = $(lcl_SOURCES) $(splint_SOURCES) all: $(BUILT_SOURCES) diff --git a/src/context.c b/src/context.c index d91d0ab..d475534 100644 --- a/src/context.c +++ b/src/context.c @@ -1745,14 +1745,14 @@ void context_enterTrueClause (exprNode e) void context_enterSwitch (exprNode e) { - + DPRINTF (("Enter switch: %s", exprNode_unparse (e))); usymtab_switchBranch (e); context_enterCondClauseAux (SWITCHCLAUSE); } void context_exitSwitch (exprNode e, bool allpaths) { - usymtab_exitSwitch (e, allpaths); + usymtab_exitSwitch (e, allpaths); while (clause_isCase (clauseStack_top (gc.clauses))) { diff --git a/src/lcllib.c b/src/lcllib.c index bd157fc..04e2a34 100644 --- a/src/lcllib.c +++ b/src/lcllib.c @@ -31,6 +31,11 @@ ** */ +/* + * Herbert 02/17/2002: + * - fixed the recognition of Posix headers for OS/2 + */ + # include "splintMacros.nf" # include "llbasic.h" # include "osd.h" @@ -124,7 +129,16 @@ lcllib_isSkipHeader (cstring sname) /*@access cstring@*/ llassert (cstring_isDefined (xname)); +# if defined (OS2) + { + /* Posixlibs use forward slashes, so we use them here, too */ + cstring_replaceAll (xname, '\\', '/'); + libname = strrchr (xname, '/'); + DPRINTF (("libname: %s", libname)); + } +# else libname = strrchr (xname, CONNECTCHAR); +# endif matchname = libname; if (libname == NULL) @@ -170,10 +184,15 @@ lcllib_isSkipHeader (cstring sname) for (i = 0; i < NUMPOSIXLIBS; i++) { - if (strchr (posixlibs[i], CONNECTCHAR) != NULL) + if (strchr (posixlibs[i], CONNECTCHAR) != NULL +# if defined (OS2) + || strchr (posixlibs[i], ALTCONNECTCHAR) != NULL +# endif + ) { char *ptr; + DPRINTF (("xname: %s, posix: %s", xname, posixlibs[i])); if ((ptr = strstr (xname, posixlibs[i])) != NULL) { if (ptr[strlen (posixlibs[i])] == '\0') diff --git a/src/messageLog.c b/src/messageLog.c index 4bc12d5..1525492 100644 --- a/src/messageLog.c +++ b/src/messageLog.c @@ -159,9 +159,6 @@ bool messageLog_add (messageLog s, fileloc fl, cstring mess) { if (msgentry_equal (msg, s->elements[ind + 1])) { - DPRINTF (("Messages equivalent: %s / %s", - msgentry_unparse (msg), - msgentry_unparse (s->elements[ind+1]))); msgentry_free (msg); return FALSE; } diff --git a/src/mtDeclarationNode.c b/src/mtDeclarationNode.c index 19c4d8f..9ac26f1 100644 --- a/src/mtDeclarationNode.c +++ b/src/mtDeclarationNode.c @@ -378,10 +378,6 @@ extern void mtDeclarationNode_process (mtDeclarationNode node, bool isglobal) } end_mtLoseReferenceList_elements ; } - /*@-usedef@*/ - DPRINTF (("metastate: %s", metaStateInfo_unparse (msinfo))); - /*@=usedef@*/ - tmerge = stateCombinationTable_create (nvalues); /* Default merge is to make all incompatible mergers errors. */ diff --git a/src/osd.c b/src/osd.c index 5a35266..17f5a0f 100644 --- a/src/osd.c +++ b/src/osd.c @@ -37,6 +37,8 @@ * Herbert 06/12/2000: * - added OS/2 specific includes before osd_getPid() * - handle files like in WIN32 for OS/2 in osd_fileExists() + * Herbert 02/17/2002: + * - added OS/2 support to absolute file names */ /*@-allmacros*/ @@ -45,14 +47,12 @@ # include /* Fix suggested by Lars Rasmussen */ # include -# ifdef WIN32 -# include -# define getcwd _getcwd -# endif /* POSIX platforms should defined getpid in unistd.h */ # if defined (WIN32) || (defined(OS2) && defined(__IBMC__)) # include +# include +# define getcwd _getcwd # else # include # endif @@ -776,7 +776,7 @@ osd_dirAbsolute (char *str) DPRINTF (("Absolute for: %s", str)); -# ifdef WIN32 +# if defined (WIN32) || defined (OS2) || defined (MSDOS) if (strlen (str) > 1 && str[1] == ':') { /* @@ -861,7 +861,7 @@ static /*@only@*/ cstring osd_cwd = cstring_undefined; static void osd_setWorkingDirectory (void) { -# ifdef UNIX +# if defined (UNIX) || defined (OS2) char *buf = dmalloc (sizeof (*buf) * MAXPATHLEN); char *cwd = getcwd (buf, MAXPATHLEN); @@ -890,7 +890,7 @@ void osd_initMod (void) cstring osd_absolutePath (cstring cwd, cstring filename) { -# ifdef UNIX +# if defined (UNIX) || defined (OS2) /* Setup the current working directory as needed. */ cstring cwd2 = cstring_isDefined (cwd) ? cwd : osd_cwd; char *abs_buffer; @@ -911,7 +911,11 @@ cstring osd_absolutePath (cstring cwd, cstring filename) { const char *src_p; - if (filename[0] != '/') + if (!osd_isConnectChar (filename[0]) +# ifdef OS2 + && !(isalpha (filename[0]) && filename[1] == ':') +# endif + ) { src_p = cwd2; @@ -920,7 +924,7 @@ cstring osd_absolutePath (cstring cwd, cstring filename) continue; } - *(endp-1) = '/'; /* overwrite null */ + *(endp-1) = CONNECTCHAR; /* overwrite null */ } src_p = filename; @@ -946,29 +950,29 @@ cstring osd_absolutePath (cstring cwd, cstring filename) { break; } - else if (inp[0] == '/' && outp[-1] == '/') + else if (osd_isConnectChar (inp[0]) && osd_isConnectChar (outp[-1])) { inp++; continue; } - else if (inp[0] == '.' && outp[-1] == '/') + else if (inp[0] == '.' && osd_isConnectChar (outp[-1])) { if (inp[1] == '\0') { break; } - else if (inp[1] == '/') + else if (osd_isConnectChar (inp[1])) { inp += 2; continue; } else if ((inp[1] == '.') - && (inp[2] == '\0' || inp[2] == '/')) + && (inp[2] == '\0' || osd_isConnectChar (inp[2]))) { - inp += (inp[2] == '/') ? 3 : 2; + inp += (osd_isConnectChar (inp[2])) ? 3 : 2; outp -= 2; - while (outp >= abs_buffer && *outp != '/') + while (outp >= abs_buffer && !osd_isConnectChar (*outp)) { outp--; } @@ -1002,7 +1006,7 @@ cstring osd_absolutePath (cstring cwd, cstring filename) the last character of the returned string is *not* a slash. */ *outp = '\0'; - if (outp[-1] == '/') + if (osd_isConnectChar (outp[-1])) *--outp = '\0'; /*@noaccess cstring@*/ @@ -1029,7 +1033,7 @@ cstring osd_absolutePath (cstring cwd, cstring filename) cstring osd_outputPath (cstring filename) { -# ifdef UNIX +# if defined (UNIX) || defined (OS2) char *rel_buffer; char *rel_buf_p; cstring cwd_p = osd_cwd; @@ -1051,7 +1055,7 @@ cstring osd_outputPath (cstring filename) path_p++; } - if ((*cwd_p == '\0') && (*path_p == '\0' || *path_p == '/')) /* whole pwd matched */ + if ((*cwd_p == '\0') && (*path_p == '\0' || osd_isConnectChar (*path_p))) /* whole pwd matched */ { if (*path_p == '\0') /* input *is* the current path! */ return cstring_makeLiteral ("."); @@ -1072,7 +1076,7 @@ cstring osd_outputPath (cstring filename) { --cwd_p; --path_p; - while (*cwd_p != '/') /* backup to last slash */ + while (!osd_isConnectChar (*cwd_p)) /* backup to last slash */ { --cwd_p; --path_p; @@ -1085,7 +1089,7 @@ cstring osd_outputPath (cstring filename) /* Find out how many directory levels in cwd were *not* matched. */ while (*cwd_p != '\0') { - if (*cwd_p++ == '/') + if (osd_isConnectChar (*cwd_p++)) unmatched_slash_count++; } @@ -1110,7 +1114,7 @@ cstring osd_outputPath (cstring filename) *rel_buf_p++ = '.'; *rel_buf_p++ = '.'; - *rel_buf_p++ = '/'; + *rel_buf_p++ = CONNECTCHAR; } /* Then tack on the unmatched part of the desired file's name. */ @@ -1127,7 +1131,7 @@ cstring osd_outputPath (cstring filename) /*@=usereleased@*/ /*@i523! shouldn't need these */ --rel_buf_p; - if (*(rel_buf_p-1) == '/') + if (osd_isConnectChar (*(rel_buf_p-1))) *--rel_buf_p = '\0'; return rel_buffer; diff --git a/src/usymtab.c b/src/usymtab.c index 9ab0426..3b60b21 100644 --- a/src/usymtab.c +++ b/src/usymtab.c @@ -758,8 +758,6 @@ usymtab_supEntryAux (/*@notnull@*/ usymtab st, } } - DPRINTF (("Using symtab: %s", usymtab_unparseLocalAux (st))); - eindex = usymtab_getIndex (st, ename); if (eindex != NOT_FOUND) @@ -2586,6 +2584,8 @@ usymtab_newCase (/*@unused@*/ exprNode pred, exprNode last) bool mustReturn = usymtab_mustEscape (utab); usymtab stab = utab; + DPRINTF (("New case!")); + /* ** Find last case (or outer switch) */ @@ -2595,9 +2595,7 @@ usymtab_newCase (/*@unused@*/ exprNode pred, exprNode last) stab = stab->env; llassert (stab != GLOBAL_ENV); } - - /* ??? */ - + while (stab->kind == US_CBRANCH) { stab = stab->env;