Re: [fpc-pascal] How to use external linker on windows i386

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
On 06.06.2024 11:16, Sven Barth via fpc-pascal wrote: Ondrej Pokorny via fpc-pascal schrieb am Do., 6. Juni 2024, 09:30: Hello, I am on Windows 64bit, but using the i386 compiler. I have to link a 3rd party OBJ file with {$L 'xyz.obj'}. With the internal linker I get these e

Re: [fpc-pascal] Ordinal casting to enums

2024-06-06 Thread Hairy Pixels via fpc-pascal
oh, it's writeln which is doing the runtime check, thanks. Doing math on enums is probably not a smart idea though. I wonder why a subscript like [] was never added to enums. It would be nice to do: f := Fruit[banana.index + 1]; instead of dealing with raw values. A runtime check for creating e

Re: [fpc-pascal] How to use external linker on windows i386

2024-06-06 Thread Sven Barth via fpc-pascal
Ondrej Pokorny via fpc-pascal schrieb am Do., 6. Juni 2024, 09:30: > Hello, > > I am on Windows 64bit, but using the i386 compiler. > > I have to link a 3rd party OBJ file with {$L 'xyz.obj'}. > > With the internal linker I get these errors: > Error: COMDAT selection mode 0 not supported (section

Re: [fpc-pascal] Ordinal casting to enums

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
On 06.06.2024 09:19, Ondrej Pokorny via fpc-pascal wrote: writeln() converts the ordinal value to the value name and if the entry is not found, the 107 error is raised. Ondrej On 06.06.2024 06:22, Hairy Pixels via fpc-pascal wrote: [ ... ] how this works at runtime is another question. To f

Re: [fpc-pascal] Ordinal casting to enums

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
writeln() converts the ordinal value to the value name and if the entry is not found, the 107 error is raised. Ondrej On 06.06.2024 06:22, Hairy Pixels via fpc-pascal wrote: This program below crashes because the value 12 is not in the enum. I was curious though, how does it know this? Does i

[fpc-pascal] How to use external linker on windows i386

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
Hello, I am on Windows 64bit, but using the i386 compiler. I have to link a 3rd party OBJ file with {$L 'xyz.obj'}. With the internal linker I get these errors: Error: COMDAT selection mode 0 not supported (section: "0") Error: Failed reading coff file, invalid section index while reading xyz.o