Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-02

special meaning of -dRELEASE

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

Hi,

today I've compiled my program the first time with a newly invented switch in my source. This program depends on some information compiled in differently for the testbed and the to be released version.

For obvious reasons I called my descriptor switch "RELEASE" and surrounded the code with "#ifdef RELEASE" to work properly.

If fpc compiles this it gives this message:

<--->
$ fpc -S2 -k-lXtst -XX -B -dRELEASE PigMain
Compiling Release Version
Free Pascal Compiler version 1.9.4 [2004/05/31] for i386 Copyright (c) 1993-2004 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
<--->

The second line makes me nervous because I think I have triggered a conflict between my code and some internal compiler magic.

What's happening here?
Do I have to rename my ifdef-identifier to avoid trouble?

Thanks,
Marc

Peter Vreman
to Marc Santhoff
Show quoted text 24 lines
Hi, today I've compiled my program the first time with a newly invented switch in my source. This program depends on some information compiled in differently for the testbed and the to be released version. For obvious reasons I called my descriptor switch "RELEASE" and surrounded the code with "#ifdef RELEASE" to work properly. If fpc compiles this it gives this message: <---> $ fpc -S2 -k-lXtst -XX -B -dRELEASE PigMain Compiling Release Version Free Pascal Compiler version 1.9.4 [2004/05/31] for i386 Copyright (c) 1993-2004 by Florian Klaempfl Target OS: FreeBSD/ELF for i386 <---> The second line makes me nervous because I think I have triggered a conflict between my code and some internal compiler magic. What's happening here? Do I have to rename my ifdef-identifier to avoid trouble?

This is no magic, see fpc.cfg

Marc Santhoff
to Peter Vreman

Am Di, den 15.02.2005 schrieb Peter Vreman um 18:20: [...]

This is no magic, see fpc.cfg

But it looks that way, I was asking myself if I've left something out because the binary shrunk from 520kB to 360kB. ;)

Thank you,
Marc

Bernhard Steffen
to Marc Santhoff
Marc Santhoff wrote
>This is no magic, see fpc.cfg But it looks that way, I was asking myself if I've left something out because the binary shrunk from 520kB to 360kB. ;)

IIRC, defining the symbol RELEASE means compiling in release mode. (Thus your internal switch does "interfere" with compiler magic. [*]) Depending on your fpc.cfg, this sets further switches like the ones for stripping out debug information from the generated binary. Have a look into your fpc.cfg for more details.

Bernhard

[*] I'm not sure whether compiling in release mode defines the RELEASE symbol or if it's the other way around. Either way, in fpc.cfg some more switches get activated when compiling with symbol RELEASE defined.

Peter Vreman
to Bernhard Steffen
Show quoted text 17 lines
Marc Santhoff wrote: >>This is no magic, see fpc.cfg > > But it looks that way, I was asking myself if I've left something out > because the binary shrunk from 520kB to 360kB. ;) IIRC, defining the symbol RELEASE means compiling in release mode. (Thus your internal switch does "interfere" with compiler magic. [*]) Depending on your fpc.cfg, this sets further switches like the ones for stripping out debug information from the generated binary. Have a look into your fpc.cfg for more details. Bernhard [*] I'm not sure whether compiling in release mode defines the RELEASE symbol or if it's the other way around. Either way, in fpc.cfg some more switches get activated when compiling with symbol RELEASE defined.

There isn't compiler functionality that can be changed by using defines. That only always works using {$directive} directives. Those can optionally set some defines, but those all have a FPC_ prefix.