[Monetdb-developers] [Monetdb-checkins] MonetDB5/src/mal mal_box.mx, , 1.78, 1.79

Fabian Groffen Fabian.Groffen at cwi.nl
Mon Jul 16 15:26:50 CEST 2007


On 16-07-2007 15:22:27 +0200, Sjoerd Mullender wrote:
> > This is actually pretty useless.  You've declared val as a const, not
> > what val point to (i.e. the chars that make up the string).
> > Consider this:
> > 
> > typedef char *str;
> > void foo(const str x)
> > {
> > 	*x = 0;
> > }
> > 
> > this is valid code and will be accepted by both gcc and icc, but this is
> > exactly what you try to prevent from happening when you declare a
> > parameter const char *.  In other words, val should be declared as const
> > char *val, and then you shouldn't need the case when calling the function.
> 
> s/case/cast/

I didn't realise a typedef is really something different for the
compiler.  Thanks for the info.  I reverted my check-in and solved it
via an intermediate buffer.




More information about the developers-list mailing list