fix warning about overflow if matiec is running on 64-bit platform,
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 06 May 2016 11:38:35 +0300
changeset 1007 afb3974f8fb3
parent 1006 0668ba32de98
child 1008 59435d4c5e0c
fix warning about overflow if matiec is running on 64-bit platform,
but the generated C code will cross-compiled for 32-bit platform

For example:
./build/config.c:29:39: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
unsigned long greatest_tick_count__ = 18446744073709551611UL; /*tick*/
^
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
stage4/generate_c/generate_c.cc
--- a/stage4/generate_c/generate_c.cc	Fri May 06 11:01:21 2016 +0300
+++ b/stage4/generate_c/generate_c.cc	Fri May 06 11:38:35 2016 +0300
@@ -2258,7 +2258,7 @@
         config_s4o.print("unsigned long long common_ticktime__ = ");
         config_s4o.print_long_long_integer(common_ticktime);
         config_s4o.print("; /*ns*/\n");
-        config_s4o.print("unsigned long greatest_tick_count__ = ");
+        config_s4o.print("unsigned long greatest_tick_count__ = (unsigned long)");
         config_s4o.print_long_integer(calculate_common_ticktime.get_greatest_tick_count());
         config_s4o.print("; /*tick*/\n");
       }