Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting K&R to ANSI C

8 views
Skip to first unread message

Cynthia Eldridge

unread,
Jun 23, 1992, 2:48:30 PM6/23/92
to

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
cyn...@ll.mit.edu

KP KP

unread,
Aug 15, 2022, 11:56:10 AM8/15/22
to
3
0 new messages