BTW, why compiler 3.3.1 does not complain?
procedure Any(const Anything);
procedure DoIt;
...
implementation
procedure Any(const Anything);
begin
end;
procedure DoIt;
begin
Any([fsItalic, fsBold]); //unit1.pas(31,25) Error: Variable identifier expected
Any(Cardinal([fsItalic, fsBold])); //ok
end;
This a
guess based on the way I've seen FPC treat parameters. The procedure "Any" uses an untyped parameter ("Anything"), because of it being untyped, the compiler will pass a pointer to whatever the parameter "Anything" happens to be. In the procedure DoIt, in the first statement, the compiler does _not_ create a temporary set it can take the address of and pass to "Any". In the second statement, the result isn't a set, just an ordinal number and the compiler can easily put that on the stack and pass the address on the stack where that _number_ (not set) is located.
Put a different way, I've observed that FPC does _not_ create temporary sets on the fly. That part is _not_ a guess, it's a fact. That fact is where the above guess comes from.
Hopefully, one of the developers can confirm if the above guess is correct or not.