Skip to content

-M compiler parameter overrides PACKSET settings from MODE

Summary

The -M compile parameter overrides the PACKSET settings from {$MODE}

System Information

  • Operating system: Windows
  • Processor architecture: x86
  • Compiler version: trunk
  • Device: Computer

Steps to reproduce

program SetTest;
{$mode objfpc}
type
  TEnum = (one, two);
  TSet = set of TEnum;
begin
  Writeln(SizeOf(TSet));
end.

When compiled with -MDelphi it writes: 1

When compiled with -Mobjfpc it writes: 4

What is the current bug behavior?

The output changes according to the value of the -M parameter.

What is the expected (correct) behavior?

The output should always be 4 because the unit uses {$mode objfpc} and thus the -M parameter should be overridden with all default values for the MODE including PACKSET.

Docs: https://www.freepascal.org/docs-html/prog/progsu161.html

Edited by Ondrej Pokorny
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information