• Re: Converting K&R to ANSI C

    From KP KP@21:1/5 to Cynthia Eldridge on Mon Aug 15 08:56:09 2022
    On Tuesday, June 23, 1992 at 11:48:30 AM UTC-7, Cynthia Eldridge wrote:
    I apologize if this has been discussed before. If so, please send
    me the summary.
    Like many others with Sun networks, we are not looking forward
    to converting megabytes of locally developed K&R C code to ANSI C,
    in preparation for using Solaris 2.0. We are wondering just how
    others are managing the conversion. For example, we would like to
    know:
    Are folks locking software development and transitioning
    all at once? How can it be done with the least amount of
    disruption for the users? Or, are people transitioning
    gradually, over time? If so, how?
    Do utilities like protoize help a lot? Are there any other
    utilities that are recommended?
    Do utilities like protoize work well for large libraries
    and for large numbers of applications using these libraries?
    Are there any "smart" compilers that can compile either K&R
    or ANSI C? It is not recommended that K&R C and ANSI C be
    mixed, but are there any compilers that allow you do it?
    Since we need to be able to continue to developing software while
    our existing software is converted to ANSI C, we were thinking of
    making the transition in stages. The first stage would be to use special function declaration and type promotion macros in the .c and .h files
    of our libraries. The function declaration macro would expand the
    function definitions appropriately for K&R C or for ANSI C. The type promotion macros would promote parameters passed and values returned
    to double, integer, or unsigned integer (as K&R C does). In the next
    stage, applications using the libraries would be compiled in ANSI C.
    The next stage would be converting the libraries themselves to ANSI C,
    once all the applications had been converted. The final stage would be removing the macros from the libraries to clean up the code.
    Does this sound similar to what other people are doing? We are also
    worried about introducing errors. Is there anything that we need to
    watch out for?
    Any recommendations, advice, or comments would be greatly appreciated.
    Please respond to me via e-mail. I will summarize. Much thanks
    in advance.
    Cynthia
    --
    Cynthia Eldridge
    M.I.T. Lincoln Laboratory
    [email protected]
    3

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)