<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Oct 12, 2018 at 3:51 PM Sven Barth via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">All the Pascal Boolean types are not "Integer types". You can't assign<br>
any of them to a Integer or whatever without typecasting. They *all*<br>
behave like Boolean, because that was the way they were added. They are<br>
all 1-bit zero extended to the specified size.</blockquote><div>It's true for pascal sources, but the issue is not with pascal, but rather interfacing C-world (where before C99 boolean didn't quite exist).</div><div>And the whole family of boolean types (if the documentation can be trusted) was introduced for this whole purpose.</div><div><br></div><div>Documentation itself lays out pretty structured and consistent layout:</div><div>BooleanX - indicates a boolean of a size N-bits, and if the value is requested, it would be translated to either 0 or 1.<br></div><div>NNNNBool - indicates a boolean of a sizeof(NNNN), and if the value is requested, it can be anything that is non zero.</div><div><br></div><div>But since the documentation is wrong, I believe there's no consistency, and everything is pretty much target dependent. (and it's sad).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Now for the problem at hand the question is either if the ABI is<br>
implemented incorrectly or that a new kind of Boolean type is required<br>
to correctly represent the _Bool type needed by Objective C.<br></blockquote><div>I do not believe that it is Objective-C specific issue. <br></div><div>Declared BOOL macro can be used in a plain C-function call and would have the exact side effect.</div><div>(Apple puts it a special consideration <a href="https://developer.apple.com/documentation/objectivec/bool">https://developer.apple.com/documentation/objectivec/bool</a>)</div><div><br></div><div>thanks,</div><div>Dmitry</div></div></div></div>