home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / MKPROTO / MKPROTO.MAN < prev    next >
Text File  |  1989-09-07  |  2KB  |  67 lines

  1. NAME
  2.    mkproto - make prototypes for functions
  3.  
  4.  
  5. SYNOPSIS
  6.    mkproto [-n] [-s] [-p] [ file ] ...
  7.  
  8.  
  9. DESCRIPTION
  10.    Mkproto takes as input one or more C source code files, and
  11. produces as output (on the standard output stream) a list of function
  12. prototypes (a la ANSI) for the external functions defined in the
  13. given source files. This output, redirected to a file, is suitable
  14. for #include'ing in a C source file.
  15.    The function definitions in the original source
  16. may be either "old-style" (in which case appropriate prototypes are
  17. generated for the functions) or "new-style" (in which the definition
  18. includes a prototype already).
  19.    A -n option causes the line number where each function was defined
  20. to be prepended to the prototype declaration as a comment.
  21.    A -s option causes prototypes to be generated for functions declard
  22. "static" as well as extern functions.
  23.    A -p option causes the prototypes emitted to be only readable by ANSI
  24. compilers. Normally, the prototypes are "macro-ized" so that compilers
  25. with __STDC__ not defined don't see them. 
  26.    If files are specified on the command line, then a comment specifying
  27. the file of origin is emitted before the prototypes constructed from
  28. that file. If no files are given, then no comments are emitted and
  29. the C source code is taken from the standard input stream.
  30.  
  31. BUGS
  32.    Mkproto is easily confused by complicated declarations, such as
  33.          int ((*signal)())() { ...
  34. or
  35.          struct foo { int x, y; } foofunc() { ...
  36.  
  37.    Float types are not properly promoted in old style definitions,
  38. i.e.
  39.          int test(f) float f; { ...
  40. should (because of the default type conversion rules) have prototype
  41.          int test(double f);
  42. rather than the incorrect
  43.          int test(float f);
  44. generated by mkproto.
  45.  
  46.    Some programs may need to be run through the preprocessor before
  47. being run through mkproto. The -n option is unlikely to work as desired
  48. on the output of a preprocessor.
  49.  
  50.    Typedef'd types aren't correctly promoted, e.g. for
  51.         typedef schar char; int foo(x) schar x;...
  52. mkproto incorrectly generates the prototype int foo(schar x) rather than
  53. the (correct) int foo(int x).
  54.  
  55.    Functions named "inline" with no explicit type qualifiers are not
  56. recognized.
  57.  
  58. SEE ALSO
  59.    cc(1), lint(1)
  60.  
  61. AUTHOR
  62.    Eric R. Smith.
  63.  
  64. NOTE
  65.    There is no warranty for this program (as noted above, it's guaranteed
  66. to break sometimes anyways!). Mkproto is in the public domain.
  67.