Mismatch in header notification definitions causes not-applicable warnings lazarus / 64-FPC development ---------------------------------------------------------------------- 440bx · 2019-04-04 13:31 Hello, The Header control notifications are defined as being negative constants but, the NMHDR.code they are compared against is defined as a longword. This causes warnings from FPC. Specifically: Warning: range check error while evaluating constants (-306 must be between 0 and 4294967295) This occurs for all the notification codes used by the header control. ---------------------------------------------------------------------- PascalDragon · 2019-04-05 07:14 Would you mind providing a bit more context, please? Cause right now it isn't really clear what exactly you're talking about. ---------------------------------------------------------------------- Thaddy · 2019-04-05 07:55 NMHDR record member constants itself are declared as signed integers (probably legacy) but the winapi NMHDR expects  longword members. Hence the compiler barks. (/win/wininc/struct.inc is correct, messages.inc isn't) To suppress, cast to longword on use as a work-around. Solution is possibly to redeclareCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i const  HDM_TESTDUMMY = longword(-321); // instead of HDM_TESTDUMMY = -(321)var i:longint;    j:longword;   begin    i:=HDM_TESTDUMMY;  // testlongword.pas(6,8) Warning: Range check error while evaluating constants (4294966975 must be between -2147483648 and 2147483647)    j:=HDM_TESTDUMMY;  // OK.    writeln(i,'|',j);end.Is that enough context? [edit] reported in Mantis as #0035324 p.s. the example actually reverses the issue to make it clear. ---------------------------------------------------------------------- ASerge · 2019-04-05 18:13 For clarification. SDK defines such const as unsigned (commctrl.h): Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #define HDN_FIRST               (0U-300U)       // headerBut FPC as signed (commctrl.pp) 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 HDN_FIRST                    = (0-300);          // headerSo it will be enough to specify 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 HDN_FIRST                    = LongWord(0-300);          // header ---------------------------------------------------------------------- 440bx · 2019-04-05 18:34 Quote from: ASerge on April 05, 2019, 08:13:28 pmCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i HDN_FIRST                    = (0-300);          // headerSo it will be enough to specify 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 HDN_FIRST                    = LongWord(0-300);          // headerYes, fortunately, it is a very simple thing to fix. ---------------------------------------------------------------------- Thaddy · 2019-04-05 19:30 Yes. As I showed before ASerge. Aside: it is indeed legacy..