Sign in Join

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

Mailing lists / fpc-devel / 2007-06

Erroneous finalizing of const widestring array

16 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Schreiber
to Yury Sidorov: From: "Yury Sidorov" Martin, please inform us when FPC 2.1.5 will work as expected with…
Yury Sidorov wrote 15 lines
From: "Yury Sidorov" > From: "Martin Schreiber" > >> Possible show stopper for FPC 2.2: >> http://www.freepascal.org/mantis/view.php?id=9170 >> >> I suspect there are more problems, I can only debug one by one. > > Fixed and merged to fixes. Martin, please inform us when FPC 2.1.5 will work as expected with your code and no more bugs will be left. After that 2.2 release can be launched.

Another blocker:

http://www.freepascal.org/mantis/view.php?id=9190

Hopefully the last, it leads to spurions crashes of MSEide. Seems not so easy to fix without performance loss. What about an reference counted widestring type for win32?

Martin

Reply by email

Daniël Mantione
to Martin Schreiber

Op Sun, 1 Jul 2007, schreef Martin Schreiber:

Show quoted text 23 lines
On Saturday 30 June 2007 14.46, Yury Sidorov wrote: > From: "Yury Sidorov" > > > From: "Martin Schreiber" > > > >> Possible show stopper for FPC 2.2: > >> http://www.freepascal.org/mantis/view.php?id=9170 > >> > >> I suspect there are more problems, I can only debug one by one. > > > > Fixed and merged to fixes. > > Martin, please inform us when FPC 2.1.5 will work as expected with > your code and no more bugs will be left. > After that 2.2 release can be launched. > Another blocker: http://www.freepascal.org/mantis/view.php?id=9190 Hopefully the last, it leads to spurions crashes of MSEide. Seems not so easy to fix without performance loss. What about an reference counted widestring type for win32?

The main issue with extra string types is that the number of possible conversions is n*n-n. With 2 string types you need to handle just 2 conversions. With the current 3, we have 3*3-3=6 conversions. With 4, it becomes 12 conversions.

It would be 2.3+, and would not remove the need to have bug free non reference counted widestrings.

Daniël

Reply by email

Yury Sidorov
to Daniël Mantione
Show quoted text 37 lines
From: "Daniël Mantione" Op Sun, 1 Jul 2007, schreef Martin Schreiber: > On Saturday 30 June 2007 14.46, Yury Sidorov wrote: > > From: "Yury Sidorov" > > > > > From: "Martin Schreiber" > > > > > >> Possible show stopper for FPC 2.2: > > >> http://www.freepascal.org/mantis/view.php?id=9170 > > >> > > >> I suspect there are more problems, I can only debug one by > > >> one. > > > > > > Fixed and merged to fixes. > > > > Martin, please inform us when FPC 2.1.5 will work as expected > > with > > your code and no more bugs will be left. > > After that 2.2 release can be launched. > > > Another blocker: > > http://www.freepascal.org/mantis/view.php?id=9190 > > Hopefully the last, it leads to spurions crashes of MSEide. > Seems not so easy to fix without performance loss. > What about an reference counted widestring type for win32? The main issue with extra string types is that the number of possible conversions is n*n-n. With 2 string types you need to handle just 2 conversions. With the current 3, we have 3*3-3=6 conversions. With 4, it becomes 12 conversions. It would be 2.3+, and would not remove the need to have bug free non reference counted widestrings.

Fully agree.

Yury.

Reply by email

Marco van de Voort
to Daniël Mantione: Op Sun, 1 Jul 2007, schreef Martin Schreiber: The main issue with extra string types is…
Show quoted text 6 lines
Op Sun, 1 Jul 2007, schreef Martin Schreiber: The main issue with extra string types is that the number of possible conversions is n*n-n. With 2 string types you need to handle just 2 conversions. With the current 3, we have 3*3-3=6 conversions. With 4, it becomes 12 conversions.

3?

My count:

(Possible) Delphi string types and types that auto converted to them in some
form or the other:

- 1 (ansi)char
- 1 wide char, (both = char and widechar from now on)
- 2 (static) array of both
- 2 dynamic array of both.
- 2 open array of both,
- 2 pointer to both,
- 2 pointer to array of both ,
- 3 short,ansi,widestring types.
- 1 open array shortstring.
----
16 (FPC or Delphi/Kylix combined one more because of refcounted, non olewidestring)

Note that I didn't test all this. It was just what I could quickly think up.

Theoretic maximal number of conversions: 16*16 = 256

This is way too high of cousre:
- assumes every conversion is possible (some like open arrays are possibly readonly),
- assumes every conversion reversable.
- also 16 direct assignments to same type are included, which are less prone to automatic conversion problems.

Some other remarks gathered from the various comments (IRC and c.l.p.delphi.misc)

- Note that this even does not include some of these types in variants.
- literals. Are string literals different ?
- Are the more types of literals?
- are there conversions, not over the base string types between literals and e.g. static array of char?

Reply by email

Yury Sidorov
to Martin Schreiber

From: "Martin Schreiber"

Show quoted text 10 lines
On Saturday 30 June 2007 14.46, Yury Sidorov wrote: > Martin, please inform us when FPC 2.1.5 will work as expected with > your code and no more bugs will be left. > After that 2.2 release can be launched. > I worked now one hour with MSEide compiled with win32 FPC fixes_2_2 rev. 7933, no more problems found up to now. :-) Thanks a lot!

That's great. I hope no major bugs will be found after 2.2 release :)

Yury.

Reply by email

Yury Sidorov
to Joao Morais

From: "Joao Morais"

Show quoted text 7 lines
Yury Sidorov wrote: > That's great. I hope no major bugs will be found after 2.2 release > :) Provided that you don't use class method reference and optimization :-(

What bug report do you mean?

Yury.

Reply by email