Re: [fpc-pascal] Surprise. Comparison of method is only done on the routine address

2016-07-12 Thread Michael Van Canneyt



On Tue, 12 Jul 2016, Dennis wrote:

I always thought comparison of methods is done on both the data and the code 
part.

  TMethod = record
Code : CodePointer;
Data : Pointer;
  end;
But the following proves it is NOT.
What is the rationale behind such behavior?


AFAIK: Delphi compatibility.

Someone already made a remark about this, and this fact is now documented, it
should appear when 3.0.2 is out.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OData and Office365 REST API support

2016-07-12 Thread Jonas Maebe
Michael Van Canneyt wrote:
> PS. Maybe switching to git alone may make a checkout less painful, if we
> may
> believe some supporters... But that is the topic of a separate thread :-)

... and a separate list. Everyone, please continue all git-related
remarks/discussion on the fpc-other list.

Thanks,


Jonas
FPC mailing lists admin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OData and Office365 REST API support

2016-07-12 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said:

> PS. Maybe switching to git alone may make a checkout less painful, if we may
> believe some supporters... But that is the topic of a separate thread :-)

Wrong problem, better eliminate the need for repeated checkouts rather than
optimize them.  

The core thing to do would be to adopt a mechanism like configure where
build and source directories are strictly separated.  This would avoid 99%
of the problems of having to do a fresh checkout for automated builds, and
also be a great asset in crossbuilding.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OData and Office365 REST API support

2016-07-12 Thread Michael Van Canneyt



On Tue, 12 Jul 2016, Marco van de Voort wrote:


In our previous episode, Michael Van Canneyt said:


PS. Maybe switching to git alone may make a checkout less painful, if we may
believe some supporters... But that is the topic of a separate thread :-)


Wrong problem, better eliminate the need for repeated checkouts rather than
optimize them.


What is wrong with

svn status | grep '^?' | awk '{ print $2 }' | xargs rm -rf

This ensures a pristine copy ?

Or you can do an

svn export

from an already checked-out copy. This leaves you with a pristine copy too.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Surprise. Comparison of method is only done on the routine address

2016-07-12 Thread Dennis Poon



Michael Van Canneyt wrote:



On Tue, 12 Jul 2016, Dennis wrote:

I always thought comparison of methods is done on both the data and 
the code part.

  TMethod = record
Code : CodePointer;
Data : Pointer;
  end;
But the following proves it is NOT.
What is the rationale behind such behavior?


AFAIK: Delphi compatibility.


May I know what do they claim to be the rationale behind this decision?

Dennis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Surprise. Comparison of method is only done on the routine address

2016-07-12 Thread Michael Van Canneyt



On Tue, 12 Jul 2016, Dennis Poon wrote:




Michael Van Canneyt wrote:



On Tue, 12 Jul 2016, Dennis wrote:

I always thought comparison of methods is done on both the data and the 
code part.

  TMethod = record
Code : CodePointer;
Data : Pointer;
  end;
But the following proves it is NOT.
What is the rationale behind such behavior?


AFAIK: Delphi compatibility.


May I know what do they claim to be the rationale behind this decision?


I have no idea, I am curious myself.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OData and Office365 REST API support

2016-07-12 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said:
> > In our previous episode, Michael Van Canneyt said:
> >
> >> PS. Maybe switching to git alone may make a checkout less painful, if we 
> >> may
> >> believe some supporters... But that is the topic of a separate thread :-)
> >
> > Wrong problem, better eliminate the need for repeated checkouts rather than
> > optimize them.
> 
> What is wrong with
> 
> svn status | grep '^?' | awk '{ print $2 }' | xargs rm -rf

C:\repo\fpc>svn status | grep '^?' | awk '{ print $2 }' | xargs rm -rf
'awk' is not recognized as an internal or external command,
operable program or batch file.
 
And even besides the multiplatform angle, a simple

rm -rf buildwin32

would only delete one targets build files, and the source dir could be on
a different fs etc.

And there is not really a big disadvantage to having builddirs. (note I only
meant meant the practice of having build dirs as option, not configure or
anything else related to configure. A BUILD=../build to current make so to say)

> This ensures a pristine copy ?
> 
> Or you can do an
> 
> svn export
> 
> from an already checked-out copy. This leaves you with a pristine copy too.

That's what I did when I still had a slow link. Still related to checkout
size though.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OData and Office365 REST API support

2016-07-12 Thread Michael Van Canneyt



On Tue, 12 Jul 2016, Marco van de Voort wrote:


In our previous episode, Michael Van Canneyt said:

In our previous episode, Michael Van Canneyt said:


PS. Maybe switching to git alone may make a checkout less painful, if we may
believe some supporters... But that is the topic of a separate thread :-)


Wrong problem, better eliminate the need for repeated checkouts rather than
optimize them.


What is wrong with

svn status | grep '^?' | awk '{ print $2 }' | xargs rm -rf


C:\repo\fpc>svn status | grep '^?' | awk '{ print $2 }' | xargs rm -rf
'awk' is not recognized as an internal or external command,
operable program or batch file.

And even besides the multiplatform angle, a simple

rm -rf buildwin32

would only delete one targets build files, and the source dir could be on
a different fs etc.

And there is not really a big disadvantage to having builddirs. (note I only
meant meant the practice of having build dirs as option, not configure or
anything else related to configure. A BUILD=../build to current make so to say)


I really don't see what this solves since all resulting files are put in 
units/$CPU-$OS anyway ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] can the compiler zero any out parameter of procedure/function automatically?

2016-07-12 Thread vfclists .
On 11 July 2016 at 18:35, Dennis Poon  wrote:

>
>
> Jonas Maebe wrote:
>
>> Dennis wrote:
>>
>>> I know it is my responsibility to initialize out parameters, but I think
>>> the compiler could help us by initializing all out parameters.
>>>
>> The compiler will fill out-parameters with garbage if you use the -gt
>> command line parameter, which can help you detect such problems more
>> easily.
>>
>> If you forget to assign a value to an out-parameter in a particular
>> case, having it return nil by default could easily be just as wrong as
>> it returning any other random value. For that reason, there is no
>> support for automatically initialising out-parameters.
>>
>> How about issue a compiler warning if one forgets to zero any out
> parameter?
>
> Dennis
>
>
The compiler might warn you about it, but it shouldn't initialize them out
for you.

Computers/compilers derive their power from being idiot savants and it is
wrong to make them anything other than that.

The compiler is supposed to implement what you say in the code, not what
you mean. You are the one who has the responsibility of expressing the
required states in as much detail as is possible.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Resource strings, passwords etc.

2016-07-12 Thread Mark Morgan Lloyd
Please excuse one of my regular silly questions. Elsewhere, a (former) 
Delphi programmer is uneasy having found that his binaries have had 
embedded SQL queries, passwords and so on visible "in clear" for the 
last 20 years or so.


Can FPC be told to obfuscate ResourceStrings?

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Resource strings, passwords etc.

2016-07-12 Thread Graeme Geldenhuys
On 2016-07-12 20:12, Mark Morgan Lloyd wrote:
> Can FPC be told to obfuscate ResourceStrings?

No, but why the hell would you want to hard-code a password inside an
executable. Encrypt it externally and read it from a .INI file at
runtime (or prompt for a password). Even something as simple as
XorString() is better than nothing - compared to storing it inside your
source code.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Resource strings, passwords etc.

2016-07-12 Thread Mark Morgan Lloyd

Graeme Geldenhuys wrote:

On 2016-07-12 20:12, Mark Morgan Lloyd wrote:

Can FPC be told to obfuscate ResourceStrings?


No, but why the hell would you want to hard-code a password inside an
executable. Encrypt it externally and read it from a .INI file at
runtime (or prompt for a password). Even something as simple as
XorString() is better than nothing - compared to storing it inside your
source code.


I didn't say /I/ was the one doing it. I'm the one asking about it.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Resource strings, passwords etc.

2016-07-12 Thread Michael Van Canneyt



On Tue, 12 Jul 2016, Mark Morgan Lloyd wrote:

Please excuse one of my regular silly questions. Elsewhere, a (former) Delphi 
programmer is uneasy having found that his binaries have had embedded SQL 
queries, passwords and so on visible "in clear" for the last 20 years or so.


Can FPC be told to obfuscate ResourceStrings?


No. The default value for resourcestrings is stored as-is in the binary.

To solve this, I store the username/password encrypted in the binary as consts, 
and they are decrypted when needed.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Resource strings, passwords etc.

2016-07-12 Thread Graeme Geldenhuys
On 2016-07-12 21:09, Mark Morgan Lloyd wrote:
> I didn't say /I/ was the one doing it.

I know and I wasn’t implying you. It’s a figure of speech.

Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal