Re: [fpc-devel] Strange build error

2011-11-28 Thread Marco van de Voort
In our previous episode, Sven Barth said:
 
  This was my first guess as well, but deactivating online-scanning didn't
  help. So I uninstalled BitDefender completely, and now it worked :-)
 
 It's fascinating how much can be broken by an anti virus program -.-

If you want the full experience, I can recommend getting a support job at a
large ISP :-)
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: out vs. var (was: Re: [fpc-devel] Internal error in FPC 2.6.0rc1)

2011-11-28 Thread Michael Müller

Am 28.11.2011 um 01:05 schrieb Jonas Maebe:

 
 On 28 Nov 2011, at 00:49, Michael Müller wrote:
 
 Beside that what is than the difference between 'out' and 'var'?
 
 If you enable hints, the compiler will print a hint if it detects you passing 
 a potentially uninitialized variable to a var parameter, while it won't 
 print such a warning if you pass it to an out parameter.

But inside the routine with out parameter I had expected to get the same 
warning ;-). But this was before I learnt that at least something of an out 
parameter reaches the routine.

Why is this 'passing a potentially uninitialized variable to a var parameter' 
('bla does not seem to be initialized') message a warning for arrays and a hint 
for basic types?

 Additionally, if you use the -gt command line option then the compiler will 
 overwrite the contents of (non-reference-counted) out-parameters in the 
 function entry code. This switch will do nothing for open array parameters 
 though, because it lacks support for using the hidden high parameter to 
 determine the bounds of the array at run time.

I don't understand this restriction. In the code High() works for open arrays 
at run time.

Regards

Michael___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Re: out vs. var

2011-11-28 Thread Sven Barth

Am 28.11.2011 12:02, schrieb Michael Müller:

Additionally, if you use the -gt command line option then the compiler will overwrite the 
contents of (non-reference-counted) out-parameters in the function entry code. This 
switch will do nothing for open array parameters though, because it lacks support for 
using the hidden high parameter to determine the bounds of the array at run 
time.


I don't understand this restriction. In the code High() works for open arrays 
at run time.


I suppose that the -gt code is generated on a lower level, so it can't 
just use High(), but would need to access the hidden parameter that 
contains the array length directly. And that part is simply not 
implemented, so open arrays are not handled.


Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: out vs. var (was: Re: [fpc-devel] Internal error in FPC 2.6.0rc1)

2011-11-28 Thread Jonas Maebe


On 28 Nov 2011, at 12:02, Michael Müller wrote:


Am 28.11.2011 um 01:05 schrieb Jonas Maebe:

If you enable hints, the compiler will print a hint if it detects  
you passing a potentially uninitialized variable to a var  
parameter, while it won't print such a warning if you pass it to an  
out parameter.


But inside the routine with out parameter I had expected to get  
the same warning ;-).


You do get a warning if you use an out parameter inside a routine  
without first writing to it.


Why is this 'passing a potentially uninitialized variable to a var  
parameter' ('bla does not seem to be initialized') message a warning  
for arrays and a hint for basic types?


It's only a warning for dynamic arrays. And the cause is a side effect  
of the way a dynamic array is internally converted to an open  
array. It shouldn't be very difficult to fix that though.


I don't understand this restriction. In the code High() works for  
open arrays at run time.



See Sven's answer.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Re: out vs. var

2011-11-28 Thread Sergei Gorelkin

28.11.2011 14:26, Sven Barth пишет:

Am 28.11.2011 12:02, schrieb Michael Müller:

Additionally, if you use the -gt command line option then the compiler will 
overwrite the
contents of (non-reference-counted) out-parameters in the function entry code. 
This switch will
do nothing for open array parameters though, because it lacks support for using the 
hidden high
parameter to determine the bounds of the array at run time.


I don't understand this restriction. In the code High() works for open arrays 
at run time.


I suppose that the -gt code is generated on a lower level, so it can't just 
use High(), but would
need to access the hidden parameter that contains the array length directly. 
And that part is simply
not implemented, so open arrays are not handled.


Yes, this is simply an unimplemented feature.

Sergei

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] UnicodeStrings - Variant conversion

2011-11-28 Thread Alexander Shishkin

14.11.2011 7:02, Alexander Shishkin пишет:

Currently assigning UnicodeString to variant converts string to
WideString and makes variant of type varOleStr.
I think it should be varUString and w|o any conversion (also this is
delphi compatible). But the question is which type should be if
WideString=UnicodeString?
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


But real problem is that varUString is not supported by RTL. ( 
Variant-UnicodeString assignment can be easily overriden with operator 
overloading). Sрould I write custom variant manager also to work with 
unicode?

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] FPDoc improvements

2011-11-28 Thread Hans-Peter Diettrich
I just implemented and option to create an XML project from the 
commandline arguments. This should allow to create projects from the 
scripts and Makefiles, used to build the documentation for the standard 
libraries. See Mantis #20769.


Unfortunately there remain some problems, e.g. the FPC documentation 
cannot be created on Windows, what is one reason for the extended 
project option, but doesn't allow me to debug this feature with real 
life projects (RTL...).


I'd like to discuss some aspects of the current implementation, as well 
as this and further fpdoc extensions. PM acceptable.


DoDi

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel