[pisa-src] Re: r2524 - trunk/tools/dhcp/mac2ip.c

  • From: Christof Mroz <christof.mroz@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Fri, 08 Apr 2011 19:53:51 +0200

On Fri, 08 Apr 2011 19:42:54 +0200, Christoph Viethen <christoph.viethen@xxxxxxxxxxxxxx> wrote:


I guess I really should rephrase my question:

"mac2ip.c: In function ‘adjust_ip_to_bounds’:
mac2ip.c:263: error: assignment of read-only variable ‘lower_bounds_value’ mac2ip.c:264: error: assignment of read-only variable ‘upper_bounds_value’
mac2ip.c:265: error: assignment of read-only variable ‘num_bounds_ips’
mac2ip.c:268: error: assignment of read-only variable ‘old_ip_value’
mac2ip.c:271: error: assignment of read-only variable ‘new_ip_value’"

Ah I see what you mean now... constant variables can only be assigned on declaration, like this:

const uint32_t lower_bounds_value = ...;

Note that we lifted the requirement of declaring variables only at the start of a block in HIPL, because this makes const correctness impossible or inefficient at times... I guess that's valid for PISA as well, so: never sacrifice const correctness just for the sake of keeping declarations at the very beginning of a block.
--
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts: