[Evolution-hackers] Evolution 2.0.4 and GCC-4.0
Not Zed
notzed@ximian.com
Fri, 04 Mar 2005 10:19:00 +0800
--=-oJ6/oJQJG3JtO2cf8YYo
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
You only need to add extra parentheses to fix this. It is just an
evaluation order thing, not an lvalue cast.
On Thu, 2005-03-03 at 12:32 -0700, Zan Lynx wrote:
> I've been building my Gentoo packages with GCC 4.0 lately and caught
> this today. GCC 4.0 no longer allows using pointer casts on the left of
> an assignment. So you can't do this anymore:
> mbi = (CamelMboxMessageInfo *)mi = info;
>
> I changed that to take the cast out which left me with a warning
> message. Probably a better fix would be to split it into two
> assignments with the cast on the right-hand side.
>
> I found these in
> camel/providers/local/camel-mbox-summary.c:258
> camel/providers/local/camel-maildir-summary.c:282
>
> And since I'm compiling in a 64-bit environment, I discovered a few
> warning messages about printing size_t values with a %d format. But
> these all seemed to be debug prints so I figured it didn't matter.
--=-oJ6/oJQJG3JtO2cf8YYo
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.5.7">
</HEAD>
<BODY>
<BR>
You only need to add extra parentheses to fix this. It is just an evaluation order thing, not an lvalue cast.<BR>
<BR>
<BR>
On Thu, 2005-03-03 at 12:32 -0700, Zan Lynx wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I've been building my Gentoo packages with GCC 4.0 lately and caught</FONT>
<FONT COLOR="#000000">this today. GCC 4.0 no longer allows using pointer casts on the left of</FONT>
<FONT COLOR="#000000">an assignment. So you can't do this anymore:</FONT>
<FONT COLOR="#000000"> mbi = (CamelMboxMessageInfo *)mi = info;</FONT>
<FONT COLOR="#000000">I changed that to take the cast out which left me with a warning</FONT>
<FONT COLOR="#000000">message. Probably a better fix would be to split it into two</FONT>
<FONT COLOR="#000000">assignments with the cast on the right-hand side.</FONT>
<FONT COLOR="#000000">I found these in</FONT>
<FONT COLOR="#000000"> camel/providers/local/camel-mbox-summary.c:258</FONT>
<FONT COLOR="#000000"> camel/providers/local/camel-maildir-summary.c:282</FONT>
<FONT COLOR="#000000">And since I'm compiling in a 64-bit environment, I discovered a few</FONT>
<FONT COLOR="#000000">warning messages about printing size_t values with a %d format. But</FONT>
<FONT COLOR="#000000">these all seemed to be debug prints so I figured it didn't matter.</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-oJ6/oJQJG3JtO2cf8YYo--