Re: Automatic number to bool conversion in VFR


Tomas Pilar (tpilar)
 

But when I've tried to create more complicated expressions I have
found out some strange things:
```
suppressif (1 AND 0); - present
suppressif (1 AND 1); - present (???)
suppressif (0 OR 0); - present
suppressif (1 OR 0); - present (???)
suppressif (TRUE OR 0); - present (???)
```
It looks like for correct behaviour explicit cast is needed:
```
suppressif ((BOOLEAN)1 AND (BOOLEAN)1); - not present
suppressif ((BOOLEAN)1 OR (BOOLEAN)0); - not present
suppressif (TRUE OR (BOOLEAN)0); - not present
```

Can someone explain to me the logic when the cast statement is not present?
Hi Konstantin,

I could be wrong, but this is my understading of the situation. The process of building and using HII includes transpiling a file written in VFR into IFR bytecode. This transpilation is custom for edk2 and therefore the transpiler is likely to be more 'quirky' than what you'd expect of your mainstream compiler. Especially for less-utilised syntax structures, where it had far less user testing. I've usually limited myself to well-worn paths when writing up a VFR file for a driver.

Cheers,
Tom

Join discuss@edk2.groups.io to automatically receive all group messages.