home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / proto-unproto.1 < prev    next >
Text File  |  1991-05-30  |  27KB  |  902 lines

  1. #ifndef UNPRO
  2. #define THISPROG PROTOIZE
  3. #define thisprog protoize
  4. #define Thisprog Protoize
  5. #define otherprog unprotoize
  6. #define from_convention varargs
  7. #define to_convention stdarg
  8. #else
  9. #define THISPROG UNPROTOIZE
  10. #define thisprog unprotoize
  11. #define Thisprog Unprotoize
  12. #define otherprog protoize
  13. #define from_convention stdarg
  14. #define to_convention varargs
  15. #endif
  16. .\"     Man page file for the thisprog program.
  17. .\"  
  18. .\"     Written by Ron Guilmette (rfg@mcc.com).
  19. .\"  
  20. .\"     Copyright (C) 1989, 1990 Free Software Foundation, Inc.
  21. .\"  
  22. .\"  This file is part of GNU CC.
  23. .\"  
  24. .\"  GNU CC is free software; you can redistribute it and/or modify
  25. .\"  it under the terms of the GNU General Public License as published by
  26. .\"  the Free Software Foundation; either version 1, or (at your option)
  27. .\"  any later version.
  28. .\"  
  29. .\"  GNU CC is distributed in the hope that it will be useful,
  30. .\"  but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  32. .\"  GNU General Public License for more details.
  33. .\"  
  34. .\"  You should have received a copy of the GNU General Public License
  35. .\"  along with GNU CC; see the file COPYING.  If not, write to
  36. .\"  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  37. .\"
  38. .TH THISPROG 1 "21 January 1990" ""
  39. .SH NAME
  40. #ifndef UNPRO
  41. thisprog \- convert K&R C source code to ANSI C prototype format
  42. #else
  43. thisprog \- convert ANSI C source code to K&R C (unprototyped) format
  44. #endif
  45. .SH SYNOPSIS
  46. .B thisprog
  47. [
  48. #ifndef UNPRO
  49. .B -VqfnkNlgC
  50. ] [
  51. .B -B
  52. .I <dir>
  53. #else
  54. .B -VqfnkN
  55. ] [
  56. .B -i
  57. .I <str>
  58. #endif
  59. ] [
  60. .B -c
  61. .I <cc opts>
  62. ] [
  63. .I file\c
  64. \&... ]
  65. .SH DESCRIPTION
  66. .fi
  67. .ad b
  68. .I Thisprog
  69. aids in the conversion of 
  70. #ifndef UNPRO
  71. K&R C source code files to ANSI C source code files with function prototypes.
  72. This conversion is useful for eliciting more complete
  73. interface checking from ANSI C compilers, or as
  74. a preliminary step in the conversion of C programs to C++.
  75. #else
  76. ANSI C source code files to K&R C source code files without function prototypes
  77. .
  78. This conversion is useful for porting ANSI C programs to
  79. machines for which no ANSI C compiler is available.
  80. #endif
  81. .PP
  82. .I Thisprog
  83. is designed to be used in conjunction
  84. with the GNU C compiler.  The GNU C compiler does preliminary
  85. .I "information gathering"
  86. about functions by analyzing the files to be converted.
  87. The GNU C compiler may be invoked automatically as a result of
  88. running
  89. .I thisprog
  90. so it is important to have it properly installed before attempting
  91. to convert source files via
  92. .I thisprog.
  93. #ifndef UNPRO
  94. .PP
  95. .I Thisprog
  96. actually has two primary functions.  First, It converts
  97. existing function declarations and definitions
  98. to prototype form.
  99. Second, for cases in which functions
  100. are called before they have been declared
  101. (i.e. points of
  102. .I implicit
  103. function declarations),
  104. .I thisprog
  105. can be instructed to
  106. insert new prototype style function declarations
  107. into the source code.
  108. For implicit function declarations,
  109. .I thisprog
  110. can either
  111. insert the new (explicit) function declaration
  112. at the very beginning of the block which contains
  113. the implicit declaration, or (at the user\'s option)
  114. these explicit declarations can be inserted near the tops of the
  115. source files where the implicit declarations occurred.
  116. The insertion of these new (explicit) function
  117. declarations (by thisprog) assures that
  118. .B all
  119. function calls in your source files will be 
  120. checked for the correct
  121. number and types of parameters
  122. during subsequent compilations.
  123. #endif
  124. .PP
  125. .I Thisprog
  126. supports the conversion of both large and small systems of C source
  127. code to
  128. #ifndef UNPRO
  129. prototype
  130. #else
  131. unprototyped
  132. #endif
  133. form.
  134. .I Thisprog
  135. can perform the conversion of an
  136. entire program in one (batch) step.
  137. #ifndef UNPRO
  138. .PP
  139. .I Thisprog
  140. is able to convert entire systems of C source code because
  141. it knows how to use information (gleaned by the C compiler) from one
  142. source file to convert
  143. function definitions and declarations in that same source file or in
  144. other source files (as required).
  145. #endif
  146. .PP
  147. Each conversion of a system of source code to
  148. #ifndef UNPRO
  149. prototyped
  150. #else
  151. unprototyped
  152. #endif
  153. format consists of two major steps.  First, there is an
  154. .I "information gathering"
  155. step.  In this step,
  156. all of the source files that make up a given
  157. executable program are recompiled using the GNU C compiler and using the
  158. .B -fgen-aux-info
  159. option.
  160. These recompilations will be performed automatically by
  161. .I thisprog
  162. on an
  163. .I as needed
  164. basis.
  165. .PP
  166. As individual compilation steps are performed, you may notice
  167. that a side-effect of these compilations is to create files with a
  168. .B .X
  169. suffix in the same directory with the original
  170. .I base
  171. source files being compiled.
  172. During compilation with
  173. .B -fgen-aux-info,
  174. one such
  175. .B .X
  176. file is created for
  177. each
  178. .I base
  179. source file compiled.  These files contain
  180. information above function definitions and declarations and
  181. additional coded information which can be used by
  182. .I thisprog
  183. to convert your source code
  184. automatically to
  185. #ifndef UNPRO
  186. prototyped
  187. #else
  188. unprototyped
  189. #endif
  190. format.
  191. .PP
  192. After a full set of
  193. .B .X
  194. files corresponding to all of the
  195. .B .c
  196. (i.e.
  197. .I base
  198. source) files for an individual
  199. program
  200. have been created,
  201. .I thisprog
  202. performs the actual conversion step.
  203. .PP
  204. Execution of the
  205. .I thisprog
  206. program causes your original source files to be converted such that both
  207. their function declarations and their function definitions are in
  208. #ifndef UNPRO
  209. prototyped
  210. #else
  211. unprototyped
  212. #endif
  213. format.
  214. After the conversion of your system, you will be
  215. left with a set of similar (but converted) source files
  216. with the same names as your original files.
  217. .PP
  218. Before it writes each converted file back to disk,
  219. .I thisprog
  220. attempts to rename the original file, giving it a
  221. .B .save
  222. suffix.
  223. It then creates a new output file
  224. with the same name that the original file had.
  225. This ensures that if there were any hard links to the original
  226. input files, these will not be altered by the conversion process.
  227. .PP
  228. WARNING!  If for any given original file, a save file already exists,
  229. .I thisprog
  230. will assume that the existing save file contains a backup of the
  231. original file as it existed before any conversions were applied.
  232. Thus, if there is an existing save file,
  233. .I thisprog
  234. will not overwrite this existing save file, and no new backup of
  235. that particular original file will be made during that run of
  236. .I thisprog.
  237. .PP
  238. An important safety feature of
  239. .I thisprog
  240. is that it normally only tries to convert files for which you have both
  241. read and write permissions.  Also,
  242. .I thisprog
  243. will normally only convert files located in directories that you
  244. have both search and write permissions for.
  245. .PP
  246. Another safety feature is that
  247. .I thisprog
  248. will not normally convert files which
  249. are located in
  250. .I system
  251. include directories.
  252. A
  253. .I system
  254. include directory is defined by
  255. .I thisprog
  256. as either
  257. .B /usr/include
  258. (or any of its subdirectories)
  259. or a directory whose full absolute pathname includes
  260. either
  261. .B gcc-include
  262. or
  263. .B g++-include.
  264. .PP
  265. Most of the above safety features can be overridden by using the
  266. .B \-f
  267. (force) option (see below),
  268. but even when
  269. .B \-f
  270. is used, you cannot force the conversion of files for which you
  271. do not at least have read permission, or files in directories that you do not
  272. at least have write permission for.
  273. .PP
  274. Note that
  275. .I thisprog
  276. will make no attempt to convert definitions
  277. #ifndef UNPRO
  278. or declarations
  279. #endif
  280. of functions which accept a variable number of arguments
  281. and which are written using the
  282. .I from_convention
  283. conventions.
  284. All such function definitions
  285. #ifndef UNPRO
  286. and declarations
  287. #endif
  288. must be converted manually to the
  289. .I to_convention
  290. conventions.
  291. Warnings are automatically issued for
  292. .I from_convention
  293. function definitions
  294. #ifndef UNPRO
  295. and declarations
  296. #endif
  297. which are left unconverted by
  298. .I thisprog.
  299. .SH OPTIONS
  300. .I Thisprog
  301. recognizes the following options:
  302. .TP
  303. .B \-V
  304. Version number.  Causes the current version number to be
  305. printed on stderr.
  306. .TP
  307. .B \-q
  308. Quiet mode.
  309. Normally,
  310. .I thisprog
  311. may issue many verbose warnings concerning noteworthy conditions.
  312. These warnings can often be helpful to the overall conversion effort.
  313. Users who prefer not to see such messages can use the
  314. .B \-q
  315. option which suppresses most such warnings.
  316. .TP
  317. .B \-f
  318. Force mode.
  319. Use of this option overrides the normal safety
  320. features of
  321. .I thisprog.
  322. It allows for attempts to convert system include files,
  323. and files not writable by you.
  324. These conversions are still subject to all normal
  325. file protections provided by the operating system.
  326. This option should be used only with extreme caution.
  327. It can be especially dangerous to use this option when logged on as
  328. .I root.
  329. Note that when this option is used, you are allowed to convert even files
  330. that you do not have write access to.  So long as you have write access
  331. to the containing directory, conversion may occur.
  332. .TP
  333. .B \-n
  334. No convert mode.  Do not actually perform any conversions on base source files
  335. or on include files.  Rather, simply do all steps leading up to conversion
  336. and then print a list (to stdout) of the names of all files which would
  337. actually be modified if the conversions were actually performed.  This option
  338. may be useful to you if you are converting a system of source files
  339. that you are unfamiliar with.  In such cases, you may need to verify
  340. ahead of time that include files which belong to other people or to
  341. other projects will not be modified by running
  342. .I thisprog.
  343. Use of this option also implicitly enables
  344. .I keep mode.
  345. (See the
  346. .B \-k
  347. option below.)
  348. .TP
  349. .B \-k
  350. Keep mode.  Normally,
  351. .I thisprog
  352. reads the information in the
  353. .B .X
  354. files created by the GNU C compiler, and then
  355. immediately deletes these files (since they will no longer be
  356. valid or useful after conversion).  When the
  357. .B \-k
  358. option is used however, the
  359. .B .X
  360. files are not deleted during conversion.
  361. .TP
  362. .B -N
  363. No save mode.  When this option is used, no attempt is made to
  364. make backups of original files (by renaming them such that they have
  365. an added
  366. .B .save
  367. suffix).
  368. Use this option with extreme caution, and
  369. only when you have previously backed up
  370. all of the files that might be converted
  371. by running
  372. .I thisprog.
  373. (See the
  374. .B -n
  375. option above.)
  376. .TP
  377. .B \-c <cc opts>
  378. Specify compile options.  The
  379. .B \-c
  380. option can be used as a means of passing on important compilation
  381. options to the C compiler.  It may often be necessary to use this option
  382. to pass command line preprocessor definitions on to the compilation step.
  383. Note that The compile options must be given as a single argument to
  384. .I thisprog.
  385. If you have more than one
  386. compilation option, you will have to quote the entire set of
  387. compilation options in order to keep the shell from treating
  388. them as separate arguments to
  389. .I thisprog.
  390. Note also that certain options are automatically suppressed by
  391. .I thisprog
  392. and cannot be passed on to the compiler (i.e.
  393. .B "-g, -O, -c, -S,"
  394. and
  395. .B "-o"
  396. are suppressed).
  397. #ifndef UNPRO
  398. .TP
  399. .B \-C
  400. C++ conversion mode.
  401. Normally,
  402. .I thisprog
  403. writes its (converted) output files back to files of the same names
  404. as the original (unconverted) input files.
  405. In C++ conversion mode,
  406. after each output file is written,
  407. a check is made to see if the given output file has a
  408. .B .c
  409. suffix.  If it does, then the given file is renamed, and its suffix
  410. is changed to
  411. .B .C.
  412. This makes the output file
  413. acceptable as a C++ input file for either the GNU C++ compiler or
  414. for the Cfront translator.
  415. .TP
  416. .B \-l
  417. Add explicit local declarations.  This option causes
  418. .I thisprog
  419. to insert
  420. explicit declarations for functions that were only implicitly declared
  421. in the original source code.  When the
  422. .B \-l
  423. option is used, lists of additional new
  424. explicit function declarations are inserted near the
  425. starts of blocks where explicit function declarations took place.
  426. (See also the
  427. .B \-g
  428. option below.)
  429. .TP
  430. .B \-g
  431. Add explicit global declarations.  This option causes
  432. .I thisprog
  433. to insert
  434. explicit declarations for functions that were only implicitly declared
  435. in your original source code.  When the
  436. .B \-g
  437. option is used, a list of additional new
  438. explicit function declarations is inserted just before the
  439. first function definition in each individual source file that previously
  440. contained implicit declarations.
  441. (See also the
  442. .B \-l
  443. option above.)
  444. .TP
  445. .B \-B <dir>
  446. Alternate library directory option.  Use this option to specify that
  447. .I thisprog
  448. should attempt to find the file
  449. .B SYSCALLS.c.X
  450. in the alternate directory indicated in the option.
  451. #else
  452. .TP
  453. .B \-i <str>
  454. Indent string option.
  455. This option can be used to specify a string to use when indenting
  456. lines containing declarations for formal parameter variables.
  457. The default indentation string for such lines is a sequence of five spaces
  458. (i.e.\ GNU style indentation) but you may use this option to specify
  459. any other string that you like (e.g.\ a tab character).
  460. Note that
  461. the shell has its own interpretations for blanks and tabs, so you
  462. will generally have to quotes the argument given in the
  463. .B -i
  464. option.
  465. #endif
  466. .SH EXAMPLES
  467. Assume that you have
  468. a directory with
  469. all of the files for your system in it.  Also
  470. assume that your system consists of two
  471. executable programs, one built from the files
  472. .B s1.c, s2.c,
  473. and
  474. .B s3.c,
  475. and the other built from the files
  476. .B s4.c
  477. and
  478. .B s5.c.
  479. Finally, assume that these source files share some common include files.
  480. .PP
  481. In order to properly convert such a system of programs, you
  482. would need to perform the steps shown below.
  483. .sp 1
  484. .in +0.5i
  485. .ft B
  486. thisprog s1.c s2.c s3.c
  487. .br
  488. thisprog s4.c s5.c
  489. .sp 1
  490. .ft R
  491. .in -0.5i
  492. .PP
  493. In the example above, the first invocation of
  494. .I thisprog
  495. causes three
  496. .B .X
  497. files (called
  498. .B s1.c.X, s2.c.X,
  499. and
  500. .B s3.c.X)
  501. to be created.
  502. These files are generated automatically by
  503. .I thisprog
  504. (which invokes the GNU C compiler to create them).
  505. These files contain information about function definitions and declarations
  506. .I both
  507. for their corresponding
  508. .B .c
  509. files and for any files
  510. which are included by these
  511. .I base
  512. .B .c
  513. files.
  514. .PP
  515. After
  516. .I thisprog
  517. has invoked the compiler for each of the files which make up
  518. .I prog1,
  519. it performs the actual conversion of these base files (and
  520. may perform some conversion of their include files
  521. depending upon the information available in the
  522. .B .X
  523. files).
  524. Finally, after performing all necessary conversions,
  525. .I thisprog
  526. automatically deletes the files
  527. .B s1.c.X, s2.c.X,
  528. and
  529. .B s3.c.X.
  530. .PP
  531. After performing the conversion for
  532. .I prog1,
  533. (as illustrated above)
  534. you would then
  535. request
  536. .I thisprog
  537. to convert all of the files which make up
  538. .I prog2
  539. in a similar fashion.
  540. This step would create two more
  541. .B .X
  542. files (called
  543. .B s4.c.X
  544. and
  545. .B s5.c.X).
  546. As with the conversion of
  547. .I prog1,
  548. .I thisprog
  549. will automatically generate any needed
  550. .B .X
  551. files (by invoking the GNU C compiler),
  552. will perform the conversion of all of the given
  553. .I base
  554. source files (and possibly do some conversion on include files),
  555. and will finish up by
  556. automatically deleting the
  557. .B .X
  558. files that were generated during this run.
  559. .PP
  560. You may occasionally find that you need to convert a
  561. particular program which
  562. consists of several
  563. .I base
  564. source files, some of which must be compiled
  565. with unusual options.
  566. In such cases, you can still convert the program via
  567. a special mechanism.
  568. For each
  569. .I base
  570. source file which requires special compilation options,
  571. you can create a corresponding
  572. .B .X
  573. file for the
  574. .I base
  575. file
  576. .I (before
  577. invoking
  578. .I thisprog).
  579. You would do this by invoking the GNU C compiler directly
  580. with the required special options, and with the
  581. .B -fgen-aux-info
  582. option.
  583. .I Thisprog
  584. is smart enough to use existing
  585. .B .X
  586. files (when they are available and when they are up to date) so creating
  587. .B .X
  588. files ahead of time with the GNU C compiler
  589. is an easy way to accommodate unusual compilation options for individual
  590. .I base
  591. files.
  592. .PP
  593. Note that
  594. .I thisprog
  595. checks each preexisting
  596. .B .X
  597. file before it tries to use it in order
  598. to insure that it is up-to-date
  599. with respect to all of the source files
  600. that it contains information about.
  601. If this check fails,
  602. .I thisprog
  603. will automatically
  604. invoke the GNU C compiler (with default options) to recreate the needed
  605. .B .X file.
  606. .SH CAVEATS
  607. #ifndef UNPRO
  608. The
  609. .I thisprog
  610. program doesn\'t just get information from your own
  611. .B .X
  612. files.  Every time
  613. .I thisprog
  614. executes, it also reads a file
  615. .B SYSCALLS.c.X
  616. from some standard installation directory
  617. (if it exists) to obtain a pre-written set of function prototypes for
  618. various standard system-supplied functions.  These prototypes are effectively
  619. added to the set of prototypes which 
  620. .I thisprog
  621. can use to perform prototype substitutions on your source files.
  622. If the source code for any individual programs that you are converting
  623. contains its own definitions
  624. for functions with the same names as standard system-supplied functions,
  625. .I thisprog
  626. is intelligent enough to allow the parameter typing from your own
  627. function definitions to take precedence over the information
  628. contained in the
  629. .B SYSCALLS.c.X
  630. file.
  631. .PP
  632. .I Thisprog
  633. changes
  634. #ifndef UNPRO
  635. (and possibly adds to)
  636. #endif
  637. your original source code
  638. in ways which may require you to rearrange the placement of other
  639. items in your code.  Specifically, it is often necessary to move
  640. around type definitions or declarations for
  641. .B "enum, struct,"
  642. and
  643. .B union
  644. types.
  645. #ifndef UNPRO
  646. .PP
  647. Usage of
  648. .I thisprog
  649. may cause source lines to grow quite long and thereby become difficult
  650. to read and to edit.  Fortunately,
  651. .I thisprog
  652. is intelligent enough to automatically break up very long lines containing
  653. newly inserted function prototypes whenever the length of
  654. any given output line would otherwise exceed 79 columns (including tabs
  655. to standard UNIX tab stops).
  656. .PP
  657. Note that in traditional (K&R) C, it was not possible to declare
  658. parameter types for
  659. .B "function pointer"
  660. parameters and variables.
  661. Such function pointer variables could only be
  662. declared with empty parameter lists in traditional C.  Unfortunately,
  663. this means that
  664. .I thisprog
  665. typically
  666. has no adequate source of information from which to manufacture
  667. appropriate (prototyped) formal argument lists for such function pointer
  668. variables.  Thus, declarations of function pointer variables and
  669. parameters will not be properly converted by
  670. .I thisprog.
  671. In the case of function pointer variables,
  672. .I thisprog
  673. currently  performs no conversion whatsoever.
  674. In the case of function pointer parameters however,
  675. .I thisprog
  676. will attempt to do half-hearted conversions by 
  677. manufacturing formal parameter lists for such parameters.
  678. These manufactured formal parameter lists will look
  679. like \`\.\.\.\'.
  680. #endif
  681. .PP
  682. #endif
  683. It is naive to assume that the conversions performed by
  684. .I thisprog
  685. are sufficient to make your source code completely compatible with
  686. #ifndef UNPRO
  687. ANSI C or C++.
  688. #else
  689. K&R C.
  690. #endif
  691. The automatic conversion of your source files via
  692. .I thisprog
  693. is only one step (albeit a big one) towards
  694. full conversion.  A full conversion may also require
  695. lots of editing "by hand".
  696. .PP
  697. .I Thisprog
  698. only converts function declarations and definitions.  No conversion of
  699. .I types
  700. (such as function types and pointer-to-function types)
  701. contained in
  702. .B typedef
  703. statements is attempted.  These must be converted manually.
  704. #ifdef UNPRO
  705. .PP
  706. Naive conversion of source code via
  707. .I thisprog
  708. may introduce bugs into the resulting (converted) code unless you are very
  709. careful.  The reason for this is rather subtle.
  710. Basically, when a call is made to a prototyped function, the types of
  711. some of the parameter values in the call may be implicitly converted
  712. to the types of the corresponding formal parameters (as declared in the
  713. function prototype).  These implicit conversions can (occasionally) involve
  714. changes of representation for the passed values (for instance from int
  715. to float).  Unfortunately, once your code has been converted via
  716. .I thisprog,
  717. these implicit conversions will no longer take place within the function
  718. calls which require them.
  719. .PP
  720. The only remedy for this problem (currently) is for users of
  721. .I thisprog
  722. to make sure that explicit casts are inserted into calls which will force
  723. these type conversions to occur even in the absence of function
  724. prototypes.  Users can determine the exact set of places where such explicit
  725. casts may be required by compiling all code to be converted using the
  726. .B -Wconversion
  727. option to GCC prior to conversion.  The warnings produced by
  728. .B -Wconversion
  729. will indicate those places in the original source code where explicit
  730. casts must be inserted.  Once these explicit casts have been manually
  731. inserted (and the warnings from
  732. .B -Wconversion
  733. eliminated), conversion may be performed without any possibility of
  734. generating code which is incorrect due to missed type conversions.
  735. #else
  736. .PP
  737. When converting to full prototype format, it may often be the case that
  738. complete information regarding the types of function parameters is not
  739. actually avaiable in the original (K&R) code.
  740. This will almost always be the case for parameters whose types are
  741. pointer-to-function types.
  742. For pointer-to-function parameters, it it customary (in K&R C) to
  743. omit the types of the arguments which the pointed-to function expects
  744. to receive.
  745. In cases where the argument types for function pointer parameters are
  746. not present in the original source code,
  747. .I thisprog
  748. notes this lack of complete information in a useful (but harmless)
  749. way.  After conversion, the (prototyped) parameter lists for 
  750. pointer-to-function parameters are represented in the converted
  751. files as comments which contain the string "???".  You can easily
  752. locate all such strings after conversion (using your favorite editor)
  753. and replace them with more complete information regarding the
  754. true parameter profile of the pointed-to functions.
  755. #endif
  756. .SH WARNINGS
  757. There are numerous possible warning and error messages which
  758. .I thisprog
  759. may issue for strange circumstances (e.g.\ missing input
  760. files, etc.) or for noteworthy conditions in the source code being converted.
  761. These should all be self-explanatory.
  762. If any message is not self-explanatory, it\'s a bug.  Please report it.
  763. .SH FILES
  764. .ta 3.0i
  765. /usr/local/bin/gcc    GNU C compiler
  766. .br
  767. /usr/local/bin/thisprog    the thisprog program
  768. #ifndef UNPRO
  769. .br
  770. /usr/local/lib/SYSCALLS.c.X    aux info file for system functions
  771. #endif
  772. .SH "SEE ALSO"
  773. gcc(1), g++(1), otherprog(1)
  774. .SH BUGS
  775. .I Thisprog
  776. can easily be confused by
  777. source code which has
  778. macro calls in the
  779. vicinity of something which it has to convert.
  780. Fortunately, such cases seem to be rare in practice.
  781. This is an inherent problem with the compiler
  782. based approach to information gathering and will likely never be fixed.
  783. When it does become confused,
  784. .I thisprog
  785. will still proceed to convert the file it is working on as much as
  786. possible.  Only the particularly confusing function definitions and
  787. declarations will fail to be converted.  These can subsequently be converted
  788. manually.
  789. .PP
  790. Due to the method currently used to gather information,
  791. .I thisprog
  792. will fail to convert function declarations and definitions which
  793. are located in conditional compilation sections which were
  794. .I "preprocessed out"
  795. during the creation of the
  796. .B .X
  797. files used for conversion.
  798. You can generally work around this problem by doing
  799. repeated conversion steps using
  800. .I thisprog,
  801. each with a different set of compilation options (i.e.\ preprocessor
  802. symbol definitions) but assuring complete conversion can
  803. currently only be done by visual inspection.
  804. Currently,
  805. .I thisprog
  806. attempts to find function definitions which were
  807. .I "preprocessed out"
  808. and to issues warnings for such cases.
  809. A later revision of
  810. .I thisprog
  811. #ifndef UNPRO
  812. may also be able to detect cases where function declarations
  813. have been
  814. .I "preprocessed out"
  815. and to issue appropriate warnings for those cases also.
  816. #else
  817. may be able to convert both function declarations and function
  818. definitions which have been
  819. .I "preprocessed out."
  820. #endif
  821. .PP
  822. Currently,
  823. .I thisprog
  824. makes no attempt to convert declarations of
  825. .I "pointer to function"
  826. types, variables, or fields.
  827. #ifdef UNPRO
  828. A later version of
  829. .I thisprog
  830. may attempt to perform conversions of these 
  831. declarative items also.
  832. #endif
  833. .PP
  834. Currently,
  835. .I from_convention
  836. functions definitions
  837. #ifndef UNPRO
  838. and declarations
  839. #endif
  840. must be converted by hand to use the
  841. .I to_convention
  842. convention.
  843. It is possible that a subsequent version of
  844. .I thisprog
  845. will make some attempt to do these conversions automatically.
  846. .PP
  847. .I Thisprog
  848. may get confused if it finds that it has to convert a function
  849. declaration or definition in a region of source code where
  850. there is more than one formal parameter list present.
  851. Thus, attempts to convert code containing
  852. multiple (conditionally compiled) versions of a single
  853. function header (in the same vicinity) may not produce
  854. the desired (or expected) results.
  855. If you plan on converting source files which contain
  856. such code, it is recommended that you first make sure
  857. that each conditionally compiled region of source
  858. code which contains an alternative function header
  859. also contains at least one additional follower token
  860. (past the final right parenthesis of the function header).
  861. This should circumvent the problem.
  862. #ifdef UNPRO
  863. .PP
  864. .I Thisprog
  865. can become confused when trying to convert a function
  866. definition or declaration
  867. which contains a declaration for a
  868. .I pointer-to-function
  869. formal argument
  870. which has the same name as the function being defined or
  871. declared.
  872. Such unfortunate choices of formal parameter names are discouraged.
  873. #endif
  874. .PP
  875. Bugs (and requests for reasonable enhancements) should be reported to
  876. rfg@ics.uci.edu.  Bugs may actually be fixed if they can be easily
  877. reproduced, so it is in your interest to report them
  878. in such a way that reproduction is easy.
  879. .SH COPYING
  880. Copyright (c) 1989, 1990 Free Software Foundation, Inc.
  881. .sp 1
  882. Permission is granted to make and distribute verbatim copies of
  883. this manual provided the copyright notice and this permission notice
  884. are preserved on all copies.
  885. .sp 1
  886. Permission is granted to copy and distribute modified versions of this
  887. manual under the conditions for verbatim copying, provided that the
  888. entire resulting derived work is distributed under the terms of a
  889. permission notice identical to this one.
  890. .sp 1
  891. Permission is granted to copy and distribute translations of this
  892. manual into another language, under the above conditions for modified
  893. versions, except that this permission notice may be included in
  894. translations approved by the Free Software Foundation instead of in
  895. the original English.
  896. .SH AUTHORS
  897. Written by Ronald F.\ Guilmette at the Microelectronics and Computer Technology
  898. Corporation (MCC).  Generously donated by MCC to the Free Software
  899. Foundation.
  900. .sp 1
  901. See the GNU C Compiler Manual for a list of contributors to GNU C.
  902.