home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume30 / cproto / patch04 / patch4
Encoding:
Text File  |  1992-07-06  |  20.6 KB  |  855 lines

  1. diff -c old/CHANGES new/CHANGES
  2. *** old/CHANGES    Fri Jul 03 13:42:00 1992
  3. --- new/CHANGES    Wed Jun 10 21:03:00 1992
  4. ***************
  5. *** 1,5 ****
  6. --- 1,29 ----
  7.   Version 3
  8.   
  9. + Patchlevel 4
  10. + - Fix: A typedef name defined as a pointer to char, short or float was
  11. +   incorrectly promoted if it was used to specify a formal parameter.
  12. +   For example, for the definition
  13. +       typedef char *caddr_t;
  14. +     int strlen (s)
  15. +     caddr_t s;
  16. +     {
  17. +     }
  18. +   cproto generated the incorrect prototype
  19. +       int strlen(int s);
  20. + - Added implementation of the ANSI function tmpfile() for systems that
  21. +   don't have it.
  22. + - If compiled with Microsoft C, cproto preprocesses its input by running
  23. +   the command "cl /E".  To eliminate the error messages when the file
  24. +   <malloc.h> is included, the program now recognizes the specifier
  25. +   _based(void).
  26.   Patchlevel 3
  27.   
  28.   - Fix: The program didn't generate prototypes for functions defined with
  29. diff -c old/config.h new/config.h
  30. *** old/config.h    Fri Jul 03 13:41:48 1992
  31. --- new/config.h    Fri Jul 03 13:37:52 1992
  32. ***************
  33. *** 1,8 ****
  34. ! /* $Id: config.h 3.3 92/04/04 13:59:06 cthuang Exp $
  35.    *
  36.    * cproto configuration and system dependencies
  37.    */
  38.   
  39.   /* maximum include file nesting */
  40.   #ifndef MAX_INC_DEPTH
  41.   #define MAX_INC_DEPTH 15
  42. --- 1,32 ----
  43. ! /* $Id: config.h 3.4 92/07/03 13:37:48 cthuang Exp $
  44.    *
  45.    * cproto configuration and system dependencies
  46.    */
  47.   
  48. + /* Borland C predefines __MSDOS__ */
  49. + #ifdef __MSDOS__
  50. + #ifndef MSDOS
  51. + #define MSDOS
  52. + #endif
  53. + #endif
  54. + /* Turbo C preprocessor */
  55. + #ifdef TURBO_CPP
  56. + #define CPP "cpp -P-"
  57. + #endif
  58. + /* Microsoft C preprocessor */
  59. + #ifdef M_I86
  60. + #define CPP "cl /E /nologo"
  61. + #endif
  62. + /* Default C preprocessor on UNIX systems */
  63. + #ifndef MSDOS
  64. + #ifndef CPP
  65. + #define CPP "/lib/cpp"
  66. + #endif
  67. + #endif
  68.   /* maximum include file nesting */
  69.   #ifndef MAX_INC_DEPTH
  70.   #define MAX_INC_DEPTH 15
  71. ***************
  72. *** 18,38 ****
  73.   #define MAX_TEXT_SIZE 256
  74.   #endif
  75.   
  76. ! /* Borland C predefines __MSDOS__ */
  77. ! #ifdef __MSDOS__
  78. ! #ifndef MSDOS
  79. ! #define MSDOS
  80. ! #endif
  81. ! #endif
  82. ! #ifdef MSDOS
  83. ! #include <malloc.h>
  84.   #include <stdlib.h>
  85.   #else
  86. - extern char *malloc();
  87. - extern char *getenv();
  88. - #endif
  89.   #ifdef BSD
  90.   #include <strings.h>
  91.   #define strchr index
  92. --- 42,51 ----
  93.   #define MAX_TEXT_SIZE 256
  94.   #endif
  95.   
  96. ! #if defined(__STDC__) || defined(MSDOS)
  97.   #include <stdlib.h>
  98. + #include <string.h>
  99.   #else
  100.   #ifdef BSD
  101.   #include <strings.h>
  102.   #define strchr index
  103. ***************
  104. *** 40,57 ****
  105.   #else
  106.   #include <string.h>
  107.   #endif
  108. ! #ifndef MSDOS
  109. ! extern char *strstr();
  110. ! #endif
  111. ! /* C preprocessor */
  112. ! #ifdef TURBO_CPP
  113. ! #define CPP "cpp -P-"
  114. ! #endif
  115. ! #ifndef MSDOS
  116. ! #ifndef CPP
  117. ! #define CPP "/lib/cpp"
  118. ! #endif
  119.   #endif
  120. --- 53,57 ----
  121.   #else
  122.   #include <string.h>
  123.   #endif
  124. ! extern char *getenv(), *malloc(), *strstr();
  125.   #endif
  126. diff -c old/cproto.1 new/cproto.1
  127. *** old/cproto.1    Fri Jul 03 13:42:02 1992
  128. --- new/cproto.1    Wed Jun 10 21:03:02 1992
  129. ***************
  130. *** 1,4 ****
  131. ! .\" $Id: cproto.1 3.5 92/04/11 19:27:07 cthuang Exp $
  132.   .\"
  133.   .de EX        \"Begin example
  134.   .ne 5
  135. --- 1,4 ----
  136. ! .\" $Id: cproto.1 3.6 92/06/10 20:55:39 cthuang Exp $
  137.   .\"
  138.   .de EX        \"Begin example
  139.   .ne 5
  140. ***************
  141. *** 58,64 ****
  142.   int argc;       /* number of arguments */
  143.   char *argv[];   /* arguments */
  144.   {
  145. -  ...
  146.   }
  147.   .EE
  148.   then the converted function definition will have the form
  149. --- 58,63 ----
  150. ***************
  151. *** 65,75 ****
  152.   .EX
  153.   int
  154.   main (
  155. !     int argc;       /* number of arguments */
  156. !     char *argv[];   /* arguments */
  157.   )
  158.   {
  159. -  ...
  160.   }
  161.   .EE
  162.   Otherwise, the converted function definition will look like
  163. --- 64,73 ----
  164.   .EX
  165.   int
  166.   main (
  167. !     int argc,       /* number of arguments */
  168. !     char *argv[]   /* arguments */
  169.   )
  170.   {
  171.   }
  172.   .EE
  173.   Otherwise, the converted function definition will look like
  174. ***************
  175. *** 77,83 ****
  176.   int
  177.   main (int argc, char *argv[])
  178.   {
  179. -  ...
  180.   }
  181.   .EE
  182.   .LP
  183. --- 75,80 ----
  184. ***************
  185. *** 108,114 ****
  186.   int argc;
  187.   char *argv[];
  188.   {
  189. -  ...
  190.   }
  191.   .EE
  192.   If the value is 0, then no prototypes are generated.
  193. --- 105,110 ----
  194. ***************
  195. *** 199,207 ****
  196.   will produce
  197.   .EX
  198.   int main(
  199. !     int argc,
  200. !     char *argv[]
  201. !     )
  202.   .EE
  203.   .TP
  204.   .BI \-D name\[=value\]
  205. --- 195,203 ----
  206.   will produce
  207.   .EX
  208.   int main(
  209. !         int argc,
  210. !         char *argv[]
  211. !         )
  212.   .EE
  213.   .TP
  214.   .BI \-D name\[=value\]
  215. diff -c old/cproto.c new/cproto.c
  216. *** old/cproto.c    Fri Jul 03 13:42:02 1992
  217. --- new/cproto.c    Wed Jun 10 21:03:08 1992
  218. ***************
  219. *** 1,9 ****
  220. ! /* $Id: cproto.c 3.5 92/04/11 19:28:01 cthuang Exp $
  221.    *
  222.    * C function prototype generator and function definition converter
  223.    */
  224.   #ifndef lint
  225. ! static char rcsid[] = "$Id: cproto.c 3.5 92/04/11 19:28:01 cthuang Exp $";
  226.   #endif
  227.   #include <stdio.h>
  228.   #include <ctype.h>
  229. --- 1,9 ----
  230. ! /* $Id: cproto.c 3.6 92/06/10 20:56:26 cthuang Exp $
  231.    *
  232.    * C function prototype generator and function definition converter
  233.    */
  234.   #ifndef lint
  235. ! static char rcsid[] = "$Id: cproto.c 3.6 92/06/10 20:56:26 cthuang Exp $";
  236.   #endif
  237.   #include <stdio.h>
  238.   #include <ctype.h>
  239. ***************
  240. *** 238,246 ****
  241.       fputs("  -v       Output variable declarations\n", stderr);
  242.       fputs("  -m name  Set name of prototype macro\n", stderr);
  243.       fputs("  -d       Omit prototype macro definition\n", stderr);
  244. !     fputs("  -P fmt   Set prototype format template \"int main (a, b)\"\n",
  245.       stderr);
  246. !     fputs("  -F fmt   Set function definition format template \"int main (a, b)\"\n",
  247.       stderr);
  248.       fputs("  -C fmt   Set format for function definition with parameter comments\n",
  249.       stderr);
  250. --- 238,246 ----
  251.       fputs("  -v       Output variable declarations\n", stderr);
  252.       fputs("  -m name  Set name of prototype macro\n", stderr);
  253.       fputs("  -d       Omit prototype macro definition\n", stderr);
  254. !     fputs("  -P fmt   Set prototype format template \" int main (a, b)\"\n",
  255.       stderr);
  256. !     fputs("  -F fmt   Set function definition format template \" int main (a, b)\"\n",
  257.       stderr);
  258.       fputs("  -C fmt   Set format for function definition with parameter comments\n",
  259.       stderr);
  260. ***************
  261. *** 469,475 ****
  262.   #endif
  263.           process_file(inf, argv[i]);
  264.   #ifdef CPP
  265. !         if (func_style == FUNC_NONE) {
  266.           pclose(inf);
  267.           } else {
  268.           pop_file();
  269. --- 469,475 ----
  270.   #endif
  271.           process_file(inf, argv[i]);
  272.   #ifdef CPP
  273. !         if (func_style == FUNC_NONE && cpp != NULL) {
  274.           pclose(inf);
  275.           } else {
  276.           pop_file();
  277. diff -c old/grammar.y new/grammar.y
  278. *** old/grammar.y    Fri Jul 03 13:42:04 1992
  279. --- new/grammar.y    Wed Jun 10 21:03:02 1992
  280. ***************
  281. *** 1,4 ****
  282. ! /* $Id: grammar.y 3.5 92/04/11 19:27:34 cthuang Exp $
  283.    *
  284.    * yacc grammar for C function prototype generator
  285.    * This was derived from the grammar in Appendix A of
  286. --- 1,4 ----
  287. ! /* $Id: grammar.y 3.6 92/06/10 20:56:07 cthuang Exp $
  288.    *
  289.    * yacc grammar for C function prototype generator
  290.    * This was derived from the grammar in Appendix A of
  291. ***************
  292. *** 6,13 ****
  293.    */
  294.   
  295.   %token <text> '(' '*'
  296. - %token
  297.       /* identifiers that are not reserved words */
  298.       T_IDENTIFIER T_TYPEDEF_NAME
  299.   
  300. --- 6,11 ----
  301. ***************
  302. *** 24,37 ****
  303.       /* type qualifiers */
  304.       T_TYPE_QUALIFIER
  305.   
  306.       /* left brace */
  307.       T_LBRACE
  308.       /* all input to the matching right brace */
  309.       T_MATCHRBRACE
  310.   
  311. -     /* paired square brackets and everything between them: [ ... ] */
  312. -     T_BRACKETS
  313.       /* three periods */
  314.       T_ELLIPSIS
  315.   
  316. --- 22,36 ----
  317.       /* type qualifiers */
  318.       T_TYPE_QUALIFIER
  319.   
  320. +     /* paired square brackets and everything between them: [ ... ] */
  321. +     T_BRACKETS
  322. + %token
  323.       /* left brace */
  324.       T_LBRACE
  325.       /* all input to the matching right brace */
  326.       T_MATCHRBRACE
  327.   
  328.       /* three periods */
  329.       T_ELLIPSIS
  330.   
  331. ***************
  332. *** 55,69 ****
  333.   %type <param_list> parameter_type_list parameter_list
  334.   %type <parameter> parameter_declaration
  335.   %type <param_list> opt_identifier_list identifier_list
  336. ! %type <text>
  337. !     struct_or_union pointer opt_type_qualifiers type_qualifier_list any_id
  338. !     T_BRACKETS
  339. !     T_IDENTIFIER T_TYPEDEF_NAME
  340. !     T_AUTO T_EXTERN T_REGISTER T_STATIC T_TYPEDEF T_INLINE
  341. !     T_CHAR T_DOUBLE T_FLOAT T_INT T_VOID T_LONG T_SHORT T_SIGNED T_UNSIGNED
  342. !     T_ENUM T_STRUCT T_UNION
  343. !     T_TYPE_QUALIFIER
  344. !     '(' '*'
  345.   
  346.   %{
  347.   #include <stdio.h>
  348. --- 54,61 ----
  349.   %type <param_list> parameter_type_list parameter_list
  350.   %type <parameter> parameter_declaration
  351.   %type <param_list> opt_identifier_list identifier_list
  352. ! %type <text> struct_or_union pointer opt_type_qualifiers type_qualifier_list
  353. !     any_id
  354.   
  355.   %{
  356.   #include <stdio.h>
  357. ***************
  358. *** 112,118 ****
  359.       | linkage_specification
  360.       | T_ASM T_ASMARG ';'
  361.       | error ';'
  362. !     | error braces
  363.       ;
  364.   
  365.   braces
  366. --- 104,116 ----
  367.       | linkage_specification
  368.       | T_ASM T_ASMARG ';'
  369.       | error ';'
  370. !     {
  371. !         yyerrok;
  372. !     }
  373. !     | error T_MATCHRBRACE
  374. !     {
  375. !         yyerrok;
  376. !     }
  377.       ;
  378.   
  379.   braces
  380. ***************
  381. *** 156,167 ****
  382.   declarator_list
  383.       : declarator
  384.       {
  385. !         new_symbol(typedef_names, $1->name, cur_decl_spec_flags);
  386.           free_declarator($1);
  387.       }
  388.       | declarator_list ',' declarator
  389.       {
  390. !         new_symbol(typedef_names, $3->name, cur_decl_spec_flags);
  391.           free_declarator($3);
  392.       }
  393.       ;
  394. --- 154,176 ----
  395.   declarator_list
  396.       : declarator
  397.       {
  398. !         int flags = cur_decl_spec_flags;
  399. !         /* If the typedef is a pointer type, then reset the short type
  400. !          * flags so it does not get promoted.
  401. !          */
  402. !         if (strcmp($1->text, $1->name) != 0)
  403. !         flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
  404. !         new_symbol(typedef_names, $1->name, flags);
  405.           free_declarator($1);
  406.       }
  407.       | declarator_list ',' declarator
  408.       {
  409. !         int flags = cur_decl_spec_flags;
  410. !         if (strcmp($3->text, $3->name) != 0)
  411. !         flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT);
  412. !         new_symbol(typedef_names, $3->name, flags);
  413.           free_declarator($3);
  414.       }
  415.       ;
  416. ***************
  417. *** 474,486 ****
  418.   type_qualifier_list
  419.       : type_qualifier
  420.       {
  421. !         strcpy($$.text, $1.text);
  422.           $$.begin = $1.begin;
  423.           free($1.text);
  424.       }
  425.       | type_qualifier_list type_qualifier
  426.       {
  427. !         sprintf($$.text, "%s %s ", $1.text, $2.text);
  428.           $$.begin = $1.begin;
  429.           free($2.text);
  430.       }
  431. --- 483,495 ----
  432.   type_qualifier_list
  433.       : type_qualifier
  434.       {
  435. !         sprintf($$.text, "%s ", $1.text);
  436.           $$.begin = $1.begin;
  437.           free($1.text);
  438.       }
  439.       | type_qualifier_list type_qualifier
  440.       {
  441. !         sprintf($$.text, "%s%s ", $1.text, $2.text);
  442.           $$.begin = $1.begin;
  443.           free($2.text);
  444.       }
  445. diff -c old/lex.l new/lex.l
  446. *** old/lex.l    Fri Jul 03 13:42:04 1992
  447. --- new/lex.l    Wed Jun 10 21:03:02 1992
  448. ***************
  449. *** 1,5 ****
  450.   %{
  451. ! /* $Id: lex.l 3.6 92/04/11 19:27:25 cthuang Exp $
  452.    *
  453.    * Lexical analyzer for C function prototype generator
  454.    */
  455. --- 1,5 ----
  456.   %{
  457. ! /* $Id: lex.l 3.7 92/06/10 20:56:04 cthuang Exp $
  458.    *
  459.    * Lexical analyzer for C function prototype generator
  460.    */
  461. ***************
  462. *** 83,92 ****
  463.                   do_include(buf, TRUE);
  464.               }
  465.   
  466.   <CPP1>[0-9]+{WS}+\".*$  {
  467.                   save_text();
  468.                   sscanf(yytext, "%d \"%[^\"]\"", &cur_file->line_num,
  469. !                 cur_file->file_name);
  470.                   cur_file->line_num--;
  471.                   BEGIN INITIAL;
  472.               }
  473. --- 83,99 ----
  474.                   do_include(buf, TRUE);
  475.               }
  476.   
  477. + <CPP1>line{WS}+[0-9]+{WS}+\".*$  {
  478. +                 save_text();
  479. +                 sscanf(yytext, "line %d \"%[^\"]\"",
  480. +                  &cur_file->line_num, cur_file->file_name);
  481. +                 cur_file->line_num--;
  482. +                 BEGIN INITIAL;
  483. +             }
  484.   <CPP1>[0-9]+{WS}+\".*$  {
  485.                   save_text();
  486.                   sscanf(yytext, "%d \"%[^\"]\"", &cur_file->line_num,
  487. !                  cur_file->file_name);
  488.                   cur_file->line_num--;
  489.                   BEGIN INITIAL;
  490.               }
  491. ***************
  492. *** 124,129 ****
  493. --- 131,138 ----
  494.   <ASM>")"        { save_text(); BEGIN INITIAL; return T_ASMARG; }
  495.   <ASM>{QUOTED}|.     save_text();
  496.   
  497. + <INITIAL>_based[^(]*\([^)]*\)    { save_text_offset(); return T_TYPE_QUALIFIER; }
  498.   <INITIAL>auto        { save_text_offset(); return T_AUTO; }
  499.   <INITIAL>extern     { save_text_offset(); return T_EXTERN; }
  500.   <INITIAL>register    { save_text_offset(); return T_REGISTER; }
  501. ***************
  502. *** 333,338 ****
  503. --- 342,385 ----
  504.   {
  505.       return cur_file->begin_comment;
  506.   }
  507. + #ifdef NEED_tmpfile
  508. + /*
  509. +  * tmpfile() - return a FILE* for a temporary file that will be
  510. +  * removed automatically when the program exits.
  511. +  * 
  512. +  * Not all systems have the ANSI tmpfile() function yet...
  513. +  *
  514. +  * DaviD W. Sanderson (dws@cs.wisc.edu)
  515. +  */
  516. + FILE *
  517. + tmpfile ()
  518. + {
  519. +     char name[1024];
  520. +     char *tmpdir;
  521. +     FILE *f;
  522. +     if ((tmpdir = getenv("TMPDIR")) == (char *)0)
  523. +     {
  524. +     tmpdir = "/tmp";
  525. +     }
  526. +     sprintf(name, "%s/TfXXXXXX", tmpdir);
  527. +     mktemp(name);
  528. +     if ((f = fopen(name, "w+")) == (FILE *)0)
  529. +     {
  530. +     return (FILE *)0;
  531. +     }
  532. +     if (unlink(name) == -1)
  533. +     {
  534. +     fclose(f);
  535. +     return (FILE *)0;
  536. +     }
  537. +     return f;
  538. + }
  539. + #endif /* NEED_tmpfile */
  540.   
  541.   /* Push a file onto the include stack.    The stream yyin must already
  542.    * point to the file.
  543. diff -c old/Makefile.msc new/Makefile.msc
  544. *** old/Makefile.msc    Fri Jul 03 13:41:44 1992
  545. --- new/Makefile.msc    Wed Jun 10 21:03:02 1992
  546. ***************
  547. *** 1,4 ****
  548. ! # $Id: makefile.msc 3.2 92/03/14 11:56:40 cthuang Exp $
  549.   #
  550.   # Microsoft C makefile for C prototype generator
  551.   
  552. --- 1,4 ----
  553. ! # $Id: makefile.msc 3.3 92/06/10 20:55:56 cthuang Exp $
  554.   #
  555.   # Microsoft C makefile for C prototype generator
  556.   
  557. ***************
  558. *** 18,29 ****
  559.   DIST3 = config.h cproto.h patchlev.h semantic.h symbol.h
  560.   DIST4 = cproto.c popen.c semantic.c strstr.c symbol.c
  561.   
  562. ! OBJECTS = cproto.obj getopt.obj semantic.obj symbol.obj y_tab.obj
  563.   
  564.   all: cproto.exe
  565.   
  566.   cproto.exe: $(OBJECTS)
  567. !     $(CC) $(CFLAGS) -Fe$*.exe $(OBJECTS) $(LIBS) $(LDFLAGS)
  568.   
  569.   y_tab.obj: y_tab.c lex_yy.c config.h cproto.h symbol.h semantic.h
  570.       $(CC) $(CFLAGS) -c $*.c
  571. --- 18,29 ----
  572.   DIST3 = config.h cproto.h patchlev.h semantic.h symbol.h
  573.   DIST4 = cproto.c popen.c semantic.c strstr.c symbol.c
  574.   
  575. ! OBJECTS = cproto.obj getopt.obj semantic.obj symbol.obj y_tab.obj popen.obj
  576.   
  577.   all: cproto.exe
  578.   
  579.   cproto.exe: $(OBJECTS)
  580. !     $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) $(LDFLAGS)
  581.   
  582.   y_tab.obj: y_tab.c lex_yy.c config.h cproto.h symbol.h semantic.h
  583.       $(CC) $(CFLAGS) -c $*.c
  584. diff -c old/Makefile.uni new/Makefile.uni
  585. *** old/Makefile.uni    Fri Jul 03 13:42:04 1992
  586. --- new/Makefile.uni    Wed Jun 10 21:03:02 1992
  587. ***************
  588. *** 1,8 ****
  589. ! # $Id: makefile.uni 3.4 92/04/11 19:27:21 cthuang Exp $
  590.   #
  591.   # UNIX makefile for C prototype generator
  592.   
  593.   # Define BSD for BSD, otherwise System V is assumed.
  594.   #DEFINES = -DBSD
  595.   
  596.   LEX = lex
  597. --- 1,9 ----
  598. ! # $Id: makefile.uni 3.5 92/06/10 20:56:00 cthuang Exp $
  599.   #
  600.   # UNIX makefile for C prototype generator
  601.   
  602.   # Define BSD for BSD, otherwise System V is assumed.
  603. + # Define NEED_tmpfile if your system does not have the ANSI function tmpfile()
  604.   #DEFINES = -DBSD
  605.   
  606.   LEX = lex
  607. diff -c old/patchlev.h new/patchlev.h
  608. *** old/patchlev.h    Fri Jul 03 13:42:04 1992
  609. --- new/patchlev.h    Wed Jun 10 21:03:08 1992
  610. ***************
  611. *** 1,1 ****
  612. ! #define PATCHLEVEL 3
  613. --- 1,1 ----
  614. ! #define PATCHLEVEL 4
  615. diff -c old/popen.c new/popen.c
  616. *** old/popen.c    Fri Jul 03 13:41:48 1992
  617. --- new/popen.c    Wed Jun 10 21:03:08 1992
  618. ***************
  619. *** 1,4 ****
  620. ! /* $Id: popen.c 3.2 92/03/14 11:58:07 cthuang Exp $
  621.    *
  622.    * Imitate a UNIX pipe in MS-DOS.
  623.    */
  624. --- 1,4 ----
  625. ! /* $Id: popen.c 3.3 92/06/10 20:56:30 cthuang Exp $
  626.    *
  627.    * Imitate a UNIX pipe in MS-DOS.
  628.    */
  629. ***************
  630. *** 34,53 ****
  631.       arg = argv;
  632.       s = strtok(cmdline, " ");
  633.       *arg++ = s;
  634. ! #ifdef M_I86
  635. !     sprintf(opt, "-o%s.", pipe_name);
  636. ! #else
  637.       sprintf(opt, "-o%s", pipe_name);
  638. - #endif
  639.       *arg++ = opt;
  640.       while ((s = strtok(NULL, " ")) != NULL) {
  641.       *arg++ = s;
  642.       }
  643.       *arg = NULL;
  644.    
  645. !     /* Redirect the program's stdout to /dev/null. */
  646.       ostdout = dup(fileno(stdout));
  647.       freopen("nul", "w", stdout);
  648.    
  649.       /* Run the program. */
  650.       status = spawnvp(P_WAIT, argv[0], argv);
  651. --- 34,55 ----
  652.       arg = argv;
  653.       s = strtok(cmdline, " ");
  654.       *arg++ = s;
  655. ! #ifdef TURBO_CPP
  656.       sprintf(opt, "-o%s", pipe_name);
  657.       *arg++ = opt;
  658. + #endif
  659.       while ((s = strtok(NULL, " ")) != NULL) {
  660.       *arg++ = s;
  661.       }
  662.       *arg = NULL;
  663.    
  664. !     /* Redirect the program's stdout. */
  665.       ostdout = dup(fileno(stdout));
  666. + #ifdef TURBO_CPP
  667.       freopen("nul", "w", stdout);
  668. + #else
  669. +     freopen(pipe_name, "w", stdout);
  670. + #endif
  671.    
  672.       /* Run the program. */
  673.       status = spawnvp(P_WAIT, argv[0], argv);
  674. diff -c old/semantic.c new/semantic.c
  675. *** old/semantic.c    Fri Jul 03 13:42:06 1992
  676. --- new/semantic.c    Wed Jun 10 21:03:08 1992
  677. ***************
  678. *** 1,4 ****
  679. ! /* $Id: semantic.c 3.5 92/04/11 19:28:08 cthuang Exp $
  680.    *
  681.    * Semantic actions executed by the parser of the
  682.    * C function prototype generator.
  683. --- 1,4 ----
  684. ! /* $Id: semantic.c 3.6 92/06/10 20:56:35 cthuang Exp $
  685.    *
  686.    * Semantic actions executed by the parser of the
  687.    * C function prototype generator.
  688. ***************
  689. *** 197,208 ****
  690.   
  691.   /* Return TRUE if the parameter is void.
  692.    */
  693. ! boolean
  694.   is_void_parameter (p)
  695.   Parameter *p;
  696.   {
  697.       return p == NULL || (strcmp(p->decl_spec.text, "void") == 0 &&
  698. !     strlen(p->declarator->text) == 0);
  699.   }
  700.   
  701.   /* Initialize a list of function parameters.
  702. --- 197,208 ----
  703.   
  704.   /* Return TRUE if the parameter is void.
  705.    */
  706. ! static boolean
  707.   is_void_parameter (p)
  708.   Parameter *p;
  709.   {
  710.       return p == NULL || (strcmp(p->decl_spec.text, "void") == 0 &&
  711. !      p->declarator->text[0] == '\0');
  712.   }
  713.   
  714.   /* Initialize a list of function parameters.
  715. ***************
  716. *** 333,340 ****
  717.   
  718.       for (d = declarators->first; d != NULL; d = d->next) {
  719.       /* Search the parameter list for a matching name. */
  720. !     p = search_parameter_list(params, d->name);
  721. !     if (p == NULL) {
  722.           put_error();
  723.           fprintf(stderr, "declared argument \"%s\" is missing\n", d->name);
  724.       } else {
  725. --- 333,339 ----
  726.   
  727.       for (d = declarators->first; d != NULL; d = d->next) {
  728.       /* Search the parameter list for a matching name. */
  729. !     if ((p = search_parameter_list(params, d->name)) == NULL) {
  730.           put_error();
  731.           fprintf(stderr, "declared argument \"%s\" is missing\n", d->name);
  732.       } else {
  733. ***************
  734. *** 364,370 ****
  735.   Parameter *p;
  736.   {
  737.       fputs(p->decl_spec.text, outf);
  738. !     if (strlen(p->declarator->text) > 0) {
  739.       if (strcmp(p->declarator->text, "...") != 0) {
  740.           if (proto_style != PROTO_ABSTRACT || proto_comments ||
  741.            where != FUNC_PROTO ||
  742. --- 363,369 ----
  743.   Parameter *p;
  744.   {
  745.       fputs(p->decl_spec.text, outf);
  746. !     if (p->declarator->text[0] != '\0') {
  747.       if (strcmp(p->declarator->text, "...") != 0) {
  748.           if (proto_style != PROTO_ABSTRACT || proto_comments ||
  749.            where != FUNC_PROTO ||
  750. ***************
  751. *** 478,484 ****
  752.       if (declarator->func_stack->func_def == FUNC_NONE) {
  753.   
  754.       decl_text = declarator->func_stack->text;
  755. !     if (strlen(declarator->name) == 0) {
  756.           fputs(decl_text, outf);
  757.       } else {
  758.   
  759. --- 477,483 ----
  760.       if (declarator->func_stack->func_def == FUNC_NONE) {
  761.   
  762.       decl_text = declarator->func_stack->text;
  763. !     if (declarator->name[0] == '\0') {
  764.           fputs(decl_text, outf);
  765.       } else {
  766.   
  767. ***************
  768. *** 551,557 ****
  769.   
  770.       if (declarator->func_def == FUNC_NONE) {
  771.       if (where == FUNC_PROTO && proto_style == PROTO_ABSTRACT &&
  772. !      strlen(declarator->name) > 0) {
  773.           if ((s = strstr(declarator->text, declarator->name)) == NULL)
  774.           return;
  775.           *s = '\0';
  776. --- 550,556 ----
  777.   
  778.       if (declarator->func_def == FUNC_NONE) {
  779.       if (where == FUNC_PROTO && proto_style == PROTO_ABSTRACT &&
  780. !      declarator->name[0] != '\0') {
  781.           if ((s = strstr(declarator->text, declarator->name)) == NULL)
  782.           return;
  783.           *s = '\0';
  784. ***************
  785. *** 625,632 ****
  786.       Parameter *p;
  787.   
  788.       for (p = declarator->params.first; p != NULL; p = p->next) {
  789. !     if (strlen(p->decl_spec.text) == 0 &&
  790. !         strcmp(p->declarator->text, "...") != 0) {
  791.           free(p->decl_spec.text);
  792.           p->decl_spec.text = xstrdup("int");
  793.       }
  794. --- 624,631 ----
  795.       Parameter *p;
  796.   
  797.       for (p = declarator->params.first; p != NULL; p = p->next) {
  798. !     if (p->decl_spec.text[0] == '\0' &&
  799. !      strcmp(p->declarator->text, "...") != 0) {
  800.           free(p->decl_spec.text);
  801.           p->decl_spec.text = xstrdup("int");
  802.       }
  803. diff -c old/semantic.h new/semantic.h
  804. *** old/semantic.h    Fri Jul 03 13:41:48 1992
  805. --- new/semantic.h    Wed Jun 10 21:03:08 1992
  806. ***************
  807. *** 1,4 ****
  808. ! /* $Id: semantic.h 3.2 92/03/06 00:54:38 cthuang Exp $
  809.    *
  810.    * Declarations of semantic action routines
  811.    */
  812. --- 1,4 ----
  813. ! /* $Id: semantic.h 3.3 92/06/10 20:56:19 cthuang Exp $
  814.    *
  815.    * Declarations of semantic action routines
  816.    */
  817. ***************
  818. *** 25,32 ****
  819.       Parameter *param, DeclSpec *decl_spec, Declarator *declarator*/);
  820.   extern void free_parameter(/*
  821.       Parameter *param*/);
  822. - extern boolean is_void_parameter(/*
  823. -     Parameter *p*/);
  824.   extern void new_param_list(/*
  825.       ParameterList *param_list, Parameter *param*/);
  826.   extern void free_param_list(/*
  827. --- 25,30 ----
  828.