develooper Front page | perl.perl5.porters | Postings from March 2005

const pointers in C

Thread Next
Andy Lester
March 9, 2005 09:02
const pointers in C
Message ID:
Do we intentionally avoid constant pointers and pointers to constant
data in the Perl source?

Seems to me that we could have some added security from the compiler if
we changed some of the internal functions of the form

  int foo( char *target, char *source )


  int foo( const char *target, const char * const source )

Might also allow some smarter compilers to optimize more aggressively.
I know that when I was doing C years ago, having the parms checked for
constness saved my ass a couple of times, and let lint be smarter.

Is this a road that we're intentionally avoiding?  Or would patches
along these lines be welcome?


Andy Lester => => => AIM:petdance

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About