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 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_copy if no conversion is required; string_copy modifies the source's flags in order to mark it as COW, and therefore its source cannot be const. I seem to recall that string_make, on the other hand, requires the 'buffer' parameter to be const, otherwise some compilers complain if it is called with a literal string. I suspect that whatever we do, some compiler will find something to complain about; all we can do is try to keep the overall noise level as low as possible. -- Peter Gibbs EmKel Systems