Stu,
looking at the code, the casts seem very misplaced. Likely they belong
to the rhs of the assignment. Or, "diff" should be declared "double" in
the first place (in all four routines). This looks like a bug spread by
cut&paste.
Martin
--- Stu Teasdale <[EMAIL PROTECTED]> wrote:
> Just had this filed against ganglia-monitor in debian. Any reason why
>
> the casts need to be there in the first place?
>
> Stu
>
> ----- Forwarded message from Andreas Jochens <[EMAIL PROTECTED]> -----
>
> From: Andreas Jochens <[EMAIL PROTECTED]>
> Reply-To: Andreas Jochens <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> To: Debian Bug Tracking System <[EMAIL PROTECTED]>
> Subject: Bug#286492: ganglia-monitor-core: FTBFS (amd64/gcc-4.0):
> invalid lvalue in assignment
> Date: Mon, 20 Dec 2004 16:09:23 +0100
> X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on caribu
> X-Spam-Level:
> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no
> version=2.64
>
> Package: ganglia-monitor-core
> Severity: normal
> Tags: patch
>
> When building 'ganglia-monitor-core' on amd64 with gcc-4.0,
> I get the following error:
>
> machine.c:71: warning: cast from pointer to integer of different size
> machine.c: In function 'pkts_in_func':
> machine.c:120: error: invalid lvalue in assignment
> machine.c: In function 'pkts_out_func':
> machine.c:180: error: invalid lvalue in assignment
> machine.c: In function 'bytes_out_func':
> machine.c:241: error: invalid lvalue in assignment
> machine.c: In function 'bytes_in_func':
> machine.c:305: error: invalid lvalue in assignment
> machine.c: In function 'cpu_num_func':
> machine.c:335: warning: implicit declaration of function 'get_nprocs'
> make[4]: *** [machine.o] Error 1
> make[4]: Leaving directory `/ganglia-monitor-core-2.5.7/gmond'
>
> With the attached patch 'ganglia-monitor-core' can be compiled
> on amd64 using gcc-4.0.
>
> Regards
> Andreas Jochens
>
> diff -urN
> ../tmp-orig/ganglia-monitor-core-2.5.7/gmond/machines/linux.c
> ./gmond/machines/linux.c
> --- ../tmp-orig/ganglia-monitor-core-2.5.7/gmond/machines/linux.c
> 2004-09-29 22:31:08.000000000 +0200
> +++ ./gmond/machines/linux.c 2004-12-20 15:50:38.711661016 +0100
> @@ -117,7 +117,7 @@
> }
> p = index (p, '\n') + 1; // skips a line
> }
> - (unsigned long) diff = pkts_in - last_pkts_in;
> + diff = pkts_in - last_pkts_in;
> if ( diff )
> {
> t = proc_net_dev.last_read - stamp;
> @@ -177,7 +177,7 @@
> }
> p = index (p, '\n') + 1; // skips a line
> }
> - (unsigned long) diff = pkts_out - last_pkts_out;
> + diff = pkts_out - last_pkts_out;
> if ( diff )
> {
> t = proc_net_dev.last_read - stamp;
> @@ -238,7 +238,7 @@
> }
> p = index (p, '\n') + 1; // skips a line
> }
> - (unsigned long) diff = bytes_out - last_bytes_out;
> + diff = bytes_out - last_bytes_out;
> if ( diff )
> {
> t = proc_net_dev.last_read - stamp;
> @@ -302,7 +302,7 @@
> }
> p = index (p, '\n') + 1; // skips a line
> }
> - (unsigned long) diff = bytes_in - last_bytes_in;
> + diff = bytes_in - last_bytes_in;
> if ( diff )
> {
> t = proc_net_dev.last_read - stamp;
>
>
> ----- End forwarded message -----
>
> --
> From the prompt of Stu Teasdale
>
> Anything labeled "NEW" and/or "IMPROVED" isn't. The label means the
> price went up. The label "ALL NEW", "COMPLETELY NEW", or "GREAT NEW"
> means the price went way up.
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
> users.
> Discover which products truly live up to the hype. Start reading now.
>
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Ganglia-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ganglia-developers
>
>
=====
------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www: http://www.knobisoft.de