[fpc-devel] Conditional define for FPC_LIMITEDEXITCODE

Sven Barth svenmauren at vr-web.de
Wed Nov 18 21:08:41 CET 2009

Hello together!

I'm currently trying to silence some compiler warnings in the Native NT 
RTL and one of these is "unreachable code" in e. g. rtl/inc/except.inc 
line 180. It seems as if FPC_LIMITEDEXITCODE is defined although that is 
not my intention. As ExitCode is defined as LongInt on Native NT and I 
didn't found any restrictions for that, I simply defined maxExitCode as 
High(LongInt) in my system.pp, hoping I'd disable any 

FPC_LIMITEDEXITCODE is defined around line 28 in system.inc in the 
following way:

     {$if High(errorcode)<>maxExitCode}
       {$define FPC_LIMITED_EXITCODE}

I understand why maxExitCode is compared with High, but why is errorcode 
used in that High? errorcode is defined as Word, while ExitCode is 
defined as LongInt (both in systemh.inc). Is that a mistake? Is it on 
purpose? Can I change it or at least circumvent it? By defining 
maxExitCode as High(Word)? Is that really the intention of this define 
and the correct use of that constant?


More information about the fpc-devel mailing list