home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fchek284.zip / ftnchek-2.8.4.patch < prev    next >
Text File  |  1996-03-29  |  7KB  |  165 lines

  1. Patch to apply to ftnchek 2.8.3 -> 2.8.4.  Bugs fixed:
  2.     1. Treated the data type double vs. real*8 mismatch
  3.        differently for args than for function invocations.  The
  4.        behavior for function invocations was wrong and is fixed.
  5.     2. Presence of EXTERNAL declaration of an undefined subprogram
  6.        would suppress cross-checking of arguments when -library
  7.        flag given and no main program present.
  8.  
  9. diff -c ftnchek-2.8.3/ftnchek.h ftnchek-2.8.4/ftnchek.h
  10. *** ftnchek-2.8.3/ftnchek.h    Wed May 31 12:07:08 1995
  11. --- ftnchek-2.8.4/ftnchek.h    Sun Nov 19 20:25:23 1995
  12. ***************
  13. *** 16,22 ****
  14.   modify it and/or redistribute it, retaining this notice.\n\
  15.   No guarantees accompany this software."
  16.   #define VERSION_NUMBER        "FTNCHEK Version 2.8 May 1995"
  17. ! #define PATCHLEVEL        "Patch Level 3"
  18.   #define PROJECT_VERSION        "P2" /* Project file format version number */
  19.       /* The following system defines should be defined with the -D
  20.          (for UNIX) or /DEFINE (for VMS) compiler options in the makefile,
  21. --- 16,22 ----
  22.   modify it and/or redistribute it, retaining this notice.\n\
  23.   No guarantees accompany this software."
  24.   #define VERSION_NUMBER        "FTNCHEK Version 2.8 May 1995"
  25. ! #define PATCHLEVEL        "Patch Level 4"
  26.   #define PROJECT_VERSION        "P2" /* Project file format version number */
  27.       /* The following system defines should be defined with the -D
  28.          (for UNIX) or /DEFINE (for VMS) compiler options in the makefile,
  29. diff -c ftnchek-2.8.3/pgsymtab.c ftnchek-2.8.4/pgsymtab.c
  30. *** ftnchek-2.8.3/pgsymtab.c    Fri Jun  2 19:07:12 1995
  31. --- ftnchek-2.8.4/pgsymtab.c    Sun Nov 19 20:24:29 1995
  32. ***************
  33. *** 748,759 ****
  34.               int typerrs = 0;
  35.               if(alist != defn_list && !alist->external_decl
  36.                  && !irrelevant(alist)) {
  37. !               int t1 = datatype_of(defn_list->type),
  38.                     t2 = datatype_of(alist->type),
  39.                     s1 = defn_list->size,
  40.                     s2 = alist->size,
  41.                     defsize1 = (s1 == size_DEFAULT),
  42. !                   defsize2 = (s2 == size_DEFAULT);
  43.           /* If -portability, do not translate default sizes so
  44.              they will never match explicit sizes. */
  45.                 if(!(port_check || local_wordsize==0)) {
  46. --- 748,763 ----
  47.               int typerrs = 0;
  48.               if(alist != defn_list && !alist->external_decl
  49.                  && !irrelevant(alist)) {
  50. !               int c1 = storage_class_of(defn_list->type),
  51. !                   c2 = storage_class_of(alist->type),
  52. !                   t1 = datatype_of(defn_list->type),
  53.                     t2 = datatype_of(alist->type),
  54.                     s1 = defn_list->size,
  55.                     s2 = alist->size,
  56.                     defsize1 = (s1 == size_DEFAULT),
  57. !                   defsize2 = (s2 == size_DEFAULT),
  58. !                   cmptype1= type_category[t1],
  59. !                   cmptype2= type_category[t2];
  60.           /* If -portability, do not translate default sizes so
  61.              they will never match explicit sizes. */
  62.                 if(!(port_check || local_wordsize==0)) {
  63. ***************
  64. *** 768,774 ****
  65.                   defsize1 = defsize2 = TRUE;
  66.                 }
  67.                   /* Check class, type, and size */
  68. !               if(defn_list->type != alist->type ||
  69.                    ( (s1 != s2) &&
  70.                   /*exclude char size-only mismatch betw calls */
  71.                     (t1 != type_STRING ||
  72. --- 772,778 ----
  73.                   defsize1 = defsize2 = TRUE;
  74.                 }
  75.                   /* Check class, type, and size */
  76. !               if( (c1 != c2) || (cmptype1 != cmptype2) ||
  77.                    ( (s1 != s2) &&
  78.                   /*exclude char size-only mismatch betw calls */
  79.                     (t1 != type_STRING ||
  80. ***************
  81. *** 1668,1675 ****
  82.       if(storage_class_of(glob_symtab[i].type) == class_SUBPROGRAM
  83.          && ! glob_symtab[i].internal_entry) {
  84.         sort_child_list(glob_symtab[i].link.child_list);
  85. !             /* Count uncalled non-library modules for use later */
  86. !       if(!glob_symtab[i].used_flag && !glob_symtab[i].library_module)
  87.         ++num_roots;    /* Count tree roots for use if no mains */
  88.       }
  89.     }
  90. --- 1672,1680 ----
  91.       if(storage_class_of(glob_symtab[i].type) == class_SUBPROGRAM
  92.          && ! glob_symtab[i].internal_entry) {
  93.         sort_child_list(glob_symtab[i].link.child_list);
  94. !      /* Count defined but uncalled non-library modules for use later */
  95. !       if(glob_symtab[i].defined && !glob_symtab[i].used_flag &&
  96. !      !glob_symtab[i].library_module)
  97.         ++num_roots;    /* Count tree roots for use if no mains */
  98.       }
  99.     }
  100. ***************
  101. *** 1720,1726 ****
  102.            */
  103.       for(i=0; i<glob_symtab_top; i++) {
  104.         if(storage_class_of(glob_symtab[i].type) == class_SUBPROGRAM
  105. !     && !glob_symtab[i].used_flag &&
  106.        (num_roots == 0 || !glob_symtab[i].library_module) ) {
  107.       if(print_ref_list)
  108.         visit_child_reflist(&glob_symtab[i]);
  109. --- 1725,1731 ----
  110.            */
  111.       for(i=0; i<glob_symtab_top; i++) {
  112.         if(storage_class_of(glob_symtab[i].type) == class_SUBPROGRAM
  113. !     && glob_symtab[i].defined && !glob_symtab[i].used_flag &&
  114.        (num_roots == 0 || !glob_symtab[i].library_module) ) {
  115.       if(print_ref_list)
  116.         visit_child_reflist(&glob_symtab[i]);
  117. diff -c ftnchek-2.8.3/project.c ftnchek-2.8.4/project.c
  118. *** ftnchek-2.8.3/project.c    Thu Oct 27 13:37:07 1994
  119. --- ftnchek-2.8.4/project.c    Tue Nov 21 12:15:07 1995
  120. ***************
  121. *** 548,554 ****
  122.       if(is_defn && (library_mode || id_library_module)) {
  123.         gsymt->library_module = TRUE;
  124.       }
  125.       if(id_used_flag)
  126.         gsymt->used_flag = TRUE;
  127.       if(id_set_flag)
  128. --- 548,555 ----
  129.       if(is_defn && (library_mode || id_library_module)) {
  130.         gsymt->library_module = TRUE;
  131.       }
  132. !     if(is_defn)
  133. !       gsymt->defined = TRUE;
  134.       if(id_used_flag)
  135.         gsymt->used_flag = TRUE;
  136.       if(id_set_flag)
  137. diff -c ftnchek-2.8.3/symtab.c ftnchek-2.8.4/symtab.c
  138. *** ftnchek-2.8.3/symtab.c    Wed May 31 11:23:26 1995
  139. --- ftnchek-2.8.4/symtab.c    Sun Nov 19 20:15:45 1995
  140. ***************
  141. *** 2781,2786 ****
  142. --- 2781,2787 ----
  143.                    gsymt->declared_external = TRUE;
  144.                 if(loc_symtab[i].library_module)
  145.                    gsymt->library_module = TRUE;
  146. +               gsymt->defined = TRUE;
  147.                 if(gsymt != curr_gsymt) {
  148.                   gsymt->internal_entry = TRUE;
  149.                   gsymt->link.module = curr_gsymt;
  150. diff -c ftnchek-2.8.3/symtab.h ftnchek-2.8.4/symtab.h
  151. *** ftnchek-2.8.3/symtab.h    Wed May 31 11:23:07 1995
  152. --- ftnchek-2.8.4/symtab.h    Sun Nov 19 20:15:45 1995
  153. ***************
  154. *** 521,526 ****
  155. --- 521,527 ----
  156.            invoked_as_func: 1,
  157.            visited: 1,       /* this entry point is in call tree */
  158.            visited_somewhere: 1, /* some entry point of module is in call tree */
  159. +          defined: 1,    /* is defined somewhere */
  160.            defined_in_include: 1,
  161.            declared_external: 1;
  162.   } Gsymtab;
  163. Common subdirectories: ftnchek-2.8.3/test and ftnchek-2.8.4/test
  164.