Assign int64 to int32 shows no warnings at compilation time. lazarus / 62-General ---------------------------------------------------------------------- dmitryb · 2018-09-16 19:45 The compilation of the following code does not show any warnings. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button9Click(Sender: TObject);var  d64: Int64;  d32: Int32;begin  d64 := Int64.MaxValue;  d32 := d64;    end; Is it possible to have warnings when the assignment has a potential overflow? ---------------------------------------------------------------------- Xor-el · 2018-09-16 20:41 did you enable range and overflow check? ---------------------------------------------------------------------- dmitryb · 2018-09-16 20:44 Yes, but it only affects the runtime, does not it? ---------------------------------------------------------------------- Xor-el · 2018-09-16 21:35 Quote from: dmitryb on September 16, 2018, 10:44:00 pmYes, but it only affects the runtime, does not it? yes.. ---------------------------------------------------------------------- Graeme · 2018-12-18 21:50 Quote from: dmitryb on September 16, 2018, 09:45:26 pmIs it possible to have warnings when the assignment has a potential overflow? Yes it can. FPC has support for warning the developer of such mistakes. Simply add the dedicated -CO compiler parameter. Below it shows the compiler warning. In the test project I assigned a variable of type Int64 to a variable of type Int32. Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ fpc -CO -vh overflow.pasHint: Start of reading config file /home/graemeg/.fpc.cfgHint: End of reading config file /home/graemeg/.fpc.cfgFree Pascal Compiler version 3.0.4+dfsg-18ubuntu2 [2018/08/29] for x86_64Copyright (c) 1993-2017 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling overflow.pasoverflow.pas(11,7) Hint: Type size mismatch, possible loss of data / range check errorLinking overflow/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?14 lines compiled, 0.0 sec3 hint(s) issued ---------------------------------------------------------------------- dmitryb · 2018-12-18 22:14 Hello I have "Type size mismatch, possible loss of data / range check error" Hint checked in the Compiler Options - Messages. But Compiler doesn't show this Hint. ---------------------------------------------------------------------- Xor-el · 2018-12-19 00:28 Quote from: dmitryb on December 18, 2018, 11:14:48 pmHello I have "Type size mismatch, possible loss of data / range check error" Hint checked in the Compiler Options - Messages. But Compiler doesn't show this Hint. you are doing it wrong. follow the numbers in my attached image below. ---------------------------------------------------------------------- dmitryb · 2018-12-20 13:50 Ok. Thanks.