[LCP]Porting code from K&R -> ANSI

Vincent Penquerc'h vincent at qubesoft.com
Tue Aug 14 20:11:05 UTC 2001


> Is there any easy way to approach this? Rather then compile, run and fix
> where it segfaults?

I'm afraid that not really.
The compiler will issue an error if it can detect this, but as soon
as you pass a pointer to the string around, it can't tell if it
points to a string constant or not, so you'll have to dig yourself.
Another possibility (not practical at all though) is to add const
correctness to your code, and that is going to be an awful experience
if you use K&R code :)

-- 
Lyrian 




More information about the linuxCprogramming mailing list