RE: [gnome-db] Patch for const removal
- From: Murray Cumming Comneon com
- To: rodrigo gnome-db org, paisa unt edu
- Cc: malerba gnome-db org, gnome-db-list gnome org
- Subject: RE: [gnome-db] Patch for const removal
- Date: Wed, 19 Nov 2003 12:17:12 +0100
> It's not about "let's do it like the cool guys", but "let's
> fix it", and I think we all agree the const's in those files
> are wrong, even if it's the correct fix semantically speaking.
Even in C++ it is impossible to use consts correctly according to any rule.
It depends on what you want the const to mean, and the compiler can not
enforce even what you want to mean. For years I thought that it could.
Ref-counting is a good example of this - If I ref it, am I changing it?. You
get to decide, not the compiler.
And it's even more difficult in C. If it works, and it doesn't seem
illogical in the API then I think it's OK.
The only consistent and workable use of const that I have seen in GNOME is
on gchar* parameters. Anything else might lead to problems.
Murray Cumming
www.murrayc.com
murrayc usa net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]