Stephane Konstantaropoulos | 18 Sep 2004 22:21
Picon

GCC 3.4 warnings

Hello,

I just updated to gcc 3.4 and it gives lots of warnings when compiling.

I use gob2 2.0.9

Notably the finalize() bit, when I declare "destroywith
gtk_widget_destroy" it warns loud saying this:

lum-skin-textbox.gob: In function `___finalize':
lum-skin-textbox.gob:67: warning: function called through a non-
compatible type
lum-skin-textbox.gob:67: note: if this code is reached, the program will
abort

This does not look good, so I have to write the finalize function myself
with correct types and it goes.

Would it not be better to just avoid casting the "destroywith" function
and let the programmer use the right one for the type he is destroying?
GCC wil warn on a type mismatch there anyway.

What do you think?

Stephane

--
to unsubscribe:
send mail to minimalist <at> 5z.com with "unsubscribe gob-list" in the subject

(Continue reading)

Stephane Konstantaropoulos | 18 Sep 2004 22:35
Picon

memset

Hello,

I get warnings that memset() is not defined in lots of my classes. It
seems to be used in the default signal handler functions.

Perhaps it would be nice to include string.h in the generated code when
defining signals?

Regards,

Stephane

--
to unsubscribe:
send mail to minimalist <at> 5z.com with "unsubscribe gob-list" in the subject

George | 23 Sep 2004 00:59
Favicon

Re: [PATCH] make private play nice with type system

On Fri, Aug 20, 2004 at 12:03:10PM -0700, George wrote:
> I've put this patch on my TODO list, but I'm going on vacation for 3 weeks
> and I don't have time to apply test and make release with this (and the file
> separator patch), so I'll just let them sit for a while and apply them when I
> get back in september.

Applying this patch in cvs

George

--

-- 
George <jirka <at> 5z.com>
   She had lost the art of conversation, 
   but not, unfortunately, the power of speech.
                       -- George Bernard Shaw

--
to unsubscribe:
send mail to minimalist <at> 5z.com with "unsubscribe gob-list" in the subject

George | 23 Sep 2004 01:10
Favicon

Re: file name separator changes.

On Fri, Aug 20, 2004 at 12:04:17PM -0700, George wrote:
> On Fri, Aug 13, 2004 at 07:45:15PM +0200, Pierre Gay wrote:
> > Hello,
> > 
> > I went with the idea that people (like me) may want to change the
> > generated file naming convention. i.e.: change "pkg-my-object.h" into
> > "pkg_my_object.h" or even "pkgmyobject.h".
> > 
> > So I join to this message the patch I use.
> > 
> > Hope this helps... Bye.
> 
> Seems mostly ok, I will test/apply this when I get back from vacations in
> september.

Applied now ...

George

--

-- 
George <jirka <at> 5z.com>
   Who killed bambi?   -- Sex Pistols

--
to unsubscribe:
send mail to minimalist <at> 5z.com with "unsubscribe gob-list" in the subject

George | 23 Sep 2004 01:26
Favicon

Re: memset

On Sat, Sep 18, 2004 at 10:35:47PM +0200, Stephane Konstantaropoulos wrote:
> Hello,
> 
> I get warnings that memset() is not defined in lots of my classes. It
> seems to be used in the default signal handler functions.
> 
> Perhaps it would be nice to include string.h in the generated code when
> defining signals?

It was included by the logic was wrong and only included it when there were
destructors ... whoops.  Fixing in CVS, will be fixed in the next version
which should come out shortly.

George

--

-- 
George <jirka <at> 5z.com>
   Beat on the brat, beat on the brat, beat on the brat, with a baseball bat.
                       -- Ramones

--
to unsubscribe:
send mail to minimalist <at> 5z.com with "unsubscribe gob-list" in the subject

George | 23 Sep 2004 02:04
Favicon

Re: GCC 3.4 warnings

On Sat, Sep 18, 2004 at 10:21:02PM +0200, Stephane Konstantaropoulos wrote:
> Hello,
> 
> I just updated to gcc 3.4 and it gives lots of warnings when compiling.
> 
> I use gob2 2.0.9
> 
> Notably the finalize() bit, when I declare "destroywith
> gtk_widget_destroy" it warns loud saying this:
> 
> lum-skin-textbox.gob: In function `___finalize':
> lum-skin-textbox.gob:67: warning: function called through a non-
> compatible type
> lum-skin-textbox.gob:67: note: if this code is reached, the program will
> abort
> 
> This does not look good, so I have to write the finalize function myself
> with correct types and it goes.
> 
> Would it not be better to just avoid casting the "destroywith" function
> and let the programmer use the right one for the type he is destroying?
> GCC wil warn on a type mismatch there anyway.
> 
> What do you think?

Well the problem is that it's ok for there to be some type mismatch.  For
example gtk_widget_destroy (you should really call that with unrefwith not
destroywith BTW) can be used to destroy a GtkButton.  If there wasn't a cast
then we'd get a type-mismatch and you'd still need to write your own
"wrapper" to remedy the problem.  C++ tries to be too smart for it's own
(Continue reading)

George | 23 Sep 2004 02:25
Favicon

ANNOUNCE: gob2 2.0.10 the "reinterpret_cast<dead>(horse)" release

EKIEKICPLUSPLUSISANAL

Given the fact that I'm not really working on gob much lately there seems
to be releases all the time.  Lots of fixes and new features mainly by
other people.

So what is this gob thing?  Well besides being the cure for cancer, it also
generates GObjects (or GTK+ objects).  GOB2 is a replacement for the version
1 GOB, that was for GTK+ 1.x mostly.  GOB2 can handle pretty much most of
the GObject features.  At least most of the ones that anyone will ever use.
It only requires GLib 2.0 and can generate arbitrary GObjects.  You can have
both versions installed at the same time if you wish, but if anyone is still
using gob version 1 and GTK+ 1.x, they should get their head examined.

Here are the news in 2.0.10:

        * Support for overriding properties (Jean-Yves Lefort)
        * Some M4 fixage with respect to NOINSTGOB (K. Haley)
        * Make the private structure allocation play nice with glib (K. Haley)
        * Add --file-sep=c option to allow changing the file separator
          character (Pierre Gay)
        * Fix C++ compilation of linked POINTER types by casting properly
          (Frank Lichtenheld) debian bug #270546
        * Always add string.h as it was missing sometimes when memset was used
        * In C++ mode cast the destroywith/unrefwith function with
          reinterpret_cast to avoid C++ nonsense (should fix compilation with
          gcc 3.4 I think)
        * Update the docs

ftp://ftp.5z.com/pub/gob/
(Continue reading)

Stephane Konstantaropoulos | 23 Sep 2004 10:33
Picon

Re: GCC 3.4 warnings

George a écrit :

>On Sat, Sep 18, 2004 at 10:21:02PM +0200, Stephane Konstantaropoulos wrote:
>  
>
>>Hello,
>>
>>I just updated to gcc 3.4 and it gives lots of warnings when compiling.
>>
>>I use gob2 2.0.9
>>
>>Notably the finalize() bit, when I declare "destroywith
>>gtk_widget_destroy" it warns loud saying this:
>>
>>lum-skin-textbox.gob: In function `___finalize':
>>lum-skin-textbox.gob:67: warning: function called through a non-
>>compatible type
>>lum-skin-textbox.gob:67: note: if this code is reached, the program will
>>abort
>>
>>This does not look good, so I have to write the finalize function myself
>>with correct types and it goes.
>>
>>Would it not be better to just avoid casting the "destroywith" function
>>and let the programmer use the right one for the type he is destroying?
>>GCC wil warn on a type mismatch there anyway.
>>
>>What do you think?
>>    
>>
(Continue reading)

George | 23 Sep 2004 17:18
Favicon

Re: GCC 3.4 warnings

On Thu, Sep 23, 2004 at 10:33:42AM +0200, Stephane Konstantaropoulos wrote:
> Thank you George,
> 
> but this problem occurs in C, not in C++. It did not occur with GCC 3.3
> and I do not use gob with --for-cpp.

Hmmm, why did I think c++, I must be confused with another bug report.  I've
also simplified the C version.  The cast was there always for C++, so for C
it now does

function_name ((gpointer) o->foo)

instead of casting the function.  That should fix it, so try 2.0.10.

George

--

-- 
George <jirka <at> 5z.com>
   History teaches us that men and nations behave wisely
   once they have exhausted all other alternatives.
                       -- Abba Eban, 1970

--
to unsubscribe:
send mail to minimalist <at> 5z.com with "unsubscribe gob-list" in the subject


Gmane