Re: [patch] constify g_simple_async_result_set_from_error
- From: Morten Welinder <mortenw gnome org>
- To: Richard Hughes <hughsient gmail com>
- Cc: gtk-devel-list gnome org, David Zeuthen <david fubar dk>
- Subject: Re: [patch] constify g_simple_async_result_set_from_error
- Date: Wed, 2 Sep 2009 14:53:47 -0400
> With this change, it won't break (or add warnings) to any program. It
> just removes a warning for programs that do not do the explicit cast,
> and get given a const GError.
Really?
Take the program below and notice that the constified prototype
introduces a warning. If used from C++, that would be an error.
So this change is an API break. That is not to say that it might
not be justified, but let's call it what it is.
Morten
static void foo (const char *s) { (void)s; }
static void bar ( char *s) { (void)s; }
int
main (int argc, char **argv)
{
void (*f1) (char *) = foo;
void (*f2) (char *) = bar;
f1 ("");
f2 ("");
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]