Questions tagged [fpc]

FPC (Free Pascal Compiler) is a 32/64-bit multi-architecture Object Pascal compiler with both Turbo Pascal, Apple Pascal and Delphi dialects.

FPC (Free Pascal Compiler) is a 16/32/64-bit multi-architecture Object Pascal compiler with both Turbo Pascal, Apple Pascal and Delphi dialects.

Free Pascal is the compiler core under the Lazarus RAD project, which provides a portable Delphi-like IDE and RAD. Lazarus has its own tag on Stackoverflow.

However Free Pascal is used directly for server/web/control apps too.

Free Pascal currently supports x86/x86_64, powerpc/powerpc64, sparc and assorted ARMs, and most popular OSes.

8086 (16-bit x86), m68k and Mips are in advanced stages of preparation in the development branch.

164 questions
20
votes
5 answers

What is the difference between Lazarus and CodeTyphon

Firstly, I saw some topics about these two but weren't my answer. I'm looking for a good FPC(Free Pascal Compiler) IDE on GNU/Linux. There are some IDE's like Lazarus and CodeTyphon. I need suggestion to choose one of those. I've tried Lazarus once…
Hamed Kamrava
  • 12,359
  • 34
  • 87
  • 125
12
votes
3 answers

How to remove warning: link.res contains output sections; did you forget -T?

I'm using fpc compiler and I want to remove this warning. I've read fpc's options but I can't find how to do that. Is this possible? it appear when I run command: fpc foo.pas out: Target OS: Linux for i386 Compiling foo.pas Linking p2…
Jack
  • 16,276
  • 55
  • 159
  • 284
10
votes
6 answers

Delphi: What are the advantages of using System.New() instead of a local variable, other than just spare a tiny amount of memory?

Let's go back to the basics. Frankly, I have never used New and Dispose functions before. However, after I read the New() documentation and the included examples on the Embarcadero Technologies's website and the Delphi Basics explanation of New(),…
Astaroth
  • 2,241
  • 18
  • 35
9
votes
2 answers

Does Freepascal really use *far* less memory than gcc

The language shootout benchmarks at http://benchmarksgame.alioth.debian.org/ indicate that FPC programs use about 1/50th of the memory that comparable programs using g++ use. Do these benchmarks unintentionally favor fpc or is it really true that…
Sudarshan S
  • 1,235
  • 2
  • 16
  • 25
8
votes
2 answers

How to inform Free Pascal Compiler to set Locale ID for the compiled application

In Delphi there is an option VersionInfo->Language->Locale ID when viewing project properties. I was wandering how to set such property for a program being compiled under Free Pascal. Any solution is welcome: command line argument or preprocessor…
algorytmus
  • 953
  • 2
  • 9
  • 28
8
votes
6 answers

Type Checking In Pascal

I'm just wondering how it's possible to do type checking in pascal? I have been searching for hours now but I haven't been able to find anything useful. Example: var number: Integer; begin write('Enter a number: '); read(number); if {How…
Radix
  • 1,317
  • 2
  • 17
  • 32
7
votes
2 answers

Simple Delphi 3d functions

Could anyone help me with examples of some bare-bone, old school 3d methods in Delphi? Not using openGL or firemonkey or any external library (vanilla canvas coding). What i want to do is to be able to rotate X number of points around a common…
Jon Lennart Aasenden
  • 3,920
  • 2
  • 29
  • 44
7
votes
2 answers

Class Reference as Property

Google is useless for these sorts of searches, because you get hundreds of millions of results absolutely none of which relate to the specific question. The question is simply this: Is it possible to have a Class Reference Property in Delphi? If…
LaKraven
  • 5,804
  • 2
  • 23
  • 49
7
votes
3 answers

Memory leak in Free Pascal caused by methods with 'pointer' parameter

After replacing hard type casts of AnsiString to TBytes (array of string) with a ToBytes method (see below), Delphi reported no memory leaks - Free Pascal 2.6.2 however shows a leak in case the TBytes value is passed to a method with a parameter of…
mjn
  • 36,362
  • 28
  • 176
  • 378
7
votes
1 answer

fpcmake and Makefile.fpc, where can I get some training?

I've never used any of these, but they are listed on the main Free Pascal site and I would really like to get my hands on: Beginners guide, to get me started Advanced guide, to help me grow All this in case it's still used/standard. Thanks
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
7
votes
1 answer

Why does gdb think my x86-64 program is i386?

I am attempting to debug a 64-bit program but gdb seems to think it has an i386 architecture. # file /usr/local/bin/foo /usr/local/bin/foo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux…
Matt Hulse
  • 5,496
  • 4
  • 29
  • 37
6
votes
2 answers

What would be involved in getting Free Pascal to compile into AVR, ATMega and Arduino?

Would it be too much of an effort to have FPC compile to the Arduino platform? I would really like to use Lazarus to do some "sketches".
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
6
votes
1 answer

FreePascal RTTI. Is there a way to invoke method?

I'm trying to find out if there is a way to do things similar to Delphi's enhanced RTTI features. As far as I know FPC doesn't provide RTTI features which appeared in Delphi since Delphi 2010. But I'd like to find some way to do a few tricks during…
Int0h
  • 71
  • 5
6
votes
2 answers

Do Pascal compilers need SecureZeroMemory function?

Consider the code: procedure DoSmthSecret; var Seed: array[0..31] of Byte; begin // get random seed .. // use the seed to do something secret .. // erase the seed FillChar(Seed, SizeOf(Seed), 0); end; The problem with the code is: FillChar…
kludg
  • 27,213
  • 5
  • 67
  • 118
6
votes
0 answers

FPC BASM32 POP bug?

Another discrepancy between Delphi and FPC BASM: program PopTest; {$IFDEF FPC} {$mode delphi} {$asmmode intel} {$ELSE} {$APPTYPE CONSOLE} {$ENDIF} var B: LongWord; procedure Pop(A: LongWord; var B: LongWord); asm PUSH EAX …
kludg
  • 27,213
  • 5
  • 67
  • 118
1
2 3
10 11