Re: Something that really annoys me in Delphi ...

From: Duncan Murdoch (dmurdoch_at_pair.com)
Date: 01/07/04


Date: Wed, 07 Jan 2004 17:22:08 -0500

On 7 Jan 2004 06:31:37 -0800, nic@aub.dk (Nicolai Hansen) wrote:

>Actually not. If I use enumerations, I keep them in range. This is
>easily done as they initialise to "0" (first value),

I might be misreading you, but just in case: variables in Delphi
don't get automatically initialized to 0.

>and within a
>type-safe language like Delphi, should be safe to get assigned
>out-of-range values.

Delphi can be used in a type-safe way, but it contains unsafe
constructs (like typecasts), untyped var parameters, etc. I wouldn't
call it a type-safe language.

>What I am looking for is to get a compiler warning removed. It is
>clearly a wrong warning in my eyes. There is nothing wrong with the
>code at the point it warns about. IF my function fails to return a
>value, it is because of a problem _elsewhere_ in the code. I would
>rather see it warn at that spot.

You're very trusting of the run-time library not to stomp on your
local variables, aren't you? A lot of the run-time (i.e. the parts in
Windows DLLs) is written in C by Microsoft, so your trust might be
misplaced.

Duncan Murdoch



Relevant Pages

  • Re: Delphi.NET vs C#: is Delphi.NET compelling?
    ... Alessandro Federici wrote: ... because it's inappropriate for a type-safe language. ... Useful articles about InterBase and Delphi development: ...
    (borland.public.delphi.non-technical)
  • Re: Does anybody really uses ALM tools ?
    ... No, nor CaliberRM, however it's a safe bet there will be licensing ... arrangements so Delphi can still integrate with these tools. ...
    (borland.public.delphi.non-technical)
  • Re: fillchar type question
    ... > of Delphi. ... Using a loop to initialize the values is certainly more ... Please elaborate on "safe" ...
    (borland.public.delphi.language.objectpascal)
  • Re: Any reported problem with this constructs?
    ... Safe, yes, recommended, no. ... > Have ANY real sense under delphi? ... I must/want to get rid of them? ...
    (borland.public.delphi.non-technical)
  • Re: Update on Who Owns the code
    ... > Sorry but you are misreading this terribly. ... > that particular copy of Delphi*. ... > more developers from using one copy of Delphi - each developer needs to ... say "the works" must bear valid copyright notice. ...
    (borland.public.delphi.non-technical)