Re: [CVS ci] string_str_index

2002-11-04 Thread Dan Sugalski
At 12:41 PM +0100 10/30/02, Leopold Toetsch wrote: Nicholas Clark wrote: Also, no-one commented on my suggestion a long time back to remove -fno-strict-aliasing from gcc's flags. In theory we're stopping some possible gcc optimisations with this. I don't see a reason, why we would need -fno-st

Re: [CVS ci] string_str_index

2002-10-30 Thread Andy Dougherty
On Wed, 30 Oct 2002, Leopold Toetsch wrote: > > Nicholas Clark suggested that we could perhaps use a union, something like > > Nice idea - works for me (gcc 2.95.2) > > Slightly modified - please try this (cc -Wall -Wcast-qual ..) > static union { > const void * __c_ptr; > void * __

Re: [CVS ci] string_str_index

2002-10-30 Thread Leopold Toetsch
Andy Dougherty wrote: On Wed, 30 Oct 2002, Leopold Toetsch wrote: [sundry 'const' warnings] Nicholas Clark suggested that we could perhaps use a union, something like Nice idea - works for me (gcc 2.95.2) Slightly modified - please try this (cc -Wall -Wcast-qual ..) static union { cons

Re: [CVS ci] string_str_index

2002-10-30 Thread Andy Dougherty
On Wed, 30 Oct 2002, Leopold Toetsch wrote: [sundry 'const' warnings] > This warning WRT (void*) buffer was introduced for tcc, says the > comment. Can we put a > #ifdef __tcc__ / #endif around this - does tcc define something like this? Short answer: Yes, but it wouldn't really make any signf

Re: [CVS ci] string_str_index

2002-10-30 Thread Leopold Toetsch
Peter Gibbs wrote: Leopold Toetsch wrote: - insert more const decls (e.g. string_trans_code doesn't modify its src, so ... At one stage all the source strings were defined as const; I believe this changed with the introduction of COW strings. For example, string_transcode may call string_co

Re: [CVS ci] string_str_index

2002-10-30 Thread Leopold Toetsch
Nicholas Clark wrote: I'd prefer more real and explicit use of const, and correcting all const-ness mistakes, rather than leaving it as a hint to the programmer. It's possible that compilers will be able to optimise better if they know something is const. Ack. Also, no-one commented on my

Re: [CVS ci] string_str_index

2002-10-30 Thread Peter Gibbs
Leopold Toetsch wrote: > - const is currently used in some string.c functions rather inconsistently > - should we remove it alltogether > - introduce a dummy CONST define as hint for the programmer > - insert more const decls (e.g. string_trans_code doesn't modify its > src, so ... At one stage al

Re: [CVS ci] string_str_index

2002-10-30 Thread Nicholas Clark
On Wed, Oct 30, 2002 at 11:13:09AM +0100, Leopold Toetsch wrote: > I moved the two - almost identical - op bodys out of core.ops > and called this functions string_str_index... > > and did introduce a new warning WRT const. > > - const is currently used in some string.c functions rather in