Re: minor api issues
- From: Owen Taylor <otaylor redhat com>
- To: Havoc Pennington <hp redhat com>
- Cc: "Matthias Clasen" <matthiasc poet de>, <gtk-devel-list gnome org>
- Subject: Re: minor api issues
- Date: 01 Oct 2001 11:45:15 -0400
Havoc Pennington <hp redhat com> writes:
> Owen Taylor <otaylor redhat com> writes:
> > gboolean foo (const char *a, G_CONST_RETURN char **b);
> >
>
> Keep in mind the tricky part that we can't tell from this prototype
> whether we have an "out string" or "in string[]"
Well, the "RETURN" there should be a strong hint. ;-)
> G_CONST_RETURN is decidedly wrong, wrong, wrong for "in string[]"
Yes, and unfortunately, there is nothing good for in string[].
const char * const *b
is "correct" in some sense, but does require a cast for almost
everybody, so it's probably better to stick to
char **b
And keep the cast and reading the prototype simpler.
> People are going to screw this up, it probably needs some heavy noting
> in the G_CONST_RETURN docs.
I'm not so worried about it. G_CONST_RETURN is ugly enough that
people won't just go blindly using it everywhere they mean 'const'.
That is, I think it should be _explained_ in the docs, but I
don't think it needs to be beaten over the head.
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]