Sign in Join

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

Mailing lists / fpc-devel / 2004-05

Many new warnings

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner

The current cvs fpc 1.9.3 gives many new warnings. The following code demonstrates 6 types, where I'm not sure why they now need a warning. Maybe the compiler cracks can tell me, which of them should I report as bugs:

program IncredibleWarnings;
{$mode objfpc}{$H+}
// range checks on
{$R+}
uses
  Classes, SysUtils;
procedure DoSomething;
const
  k = $FFFFFF;
var
  ACardinal: LongWord;
  AnInteger: integer;
  AnException: Exception;
begin
  ACardinal:=0; AnInteger:=0;
  // Warning: Mixing signed expressions and longwords gives a 64bit result
  inc(ACardinal);
  if (1 shl AnInteger)>=AnInteger then ;
  ACardinal:=ACardinal-sizeof(char);
  if ACardinal=k then ;
  if ACardinal=ord(ssLeft) then ;
  // Note: Local variable "AnException" is assigned but never used
  AnException:=Exception.Create('');
  raise AnException;
end;
begin
  DoSomething;
end.

Mattias

Reply by email

Peter Vreman
to Mattias Gaertner
Show quoted text 5 lines
The current cvs fpc 1.9.3 gives many new warnings. The following code demonstrates 6 types, where I'm not sure why they now need a warning. Maybe the compiler cracks can tell me, which of them should I report as bugs:

Now they are called 'many old warnings'.

Reply by email

Mattias Gaertner
to Peter Vreman
Show quoted text 7 lines
> > The current cvs fpc 1.9.3 gives many new warnings. The following code > demonstrates 6 types, where I'm not sure why they now need a warning. > Maybe the compiler cracks can tell me, which of them should I report as > bugs: Now they are called 'many old warnings'.

:)

Great.

I just got an amok running fpc, allocating mem in an endless loop. It's not reproducable. But it's not the first time in the last few weeks. Anything known about it?

Mattias

Reply by email

Peter Vreman
to Mattias Gaertner
you wrote 19 lines
On Fri, 28 May 2004 23:24:51 +0200 (CEST) "Peter Vreman" wrote: > > > > The current cvs fpc 1.9.3 gives many new warnings. The following code > > demonstrates 6 types, where I'm not sure why they now need a warning. > > Maybe the compiler cracks can tell me, which of them should I report as > > bugs: > > Now they are called 'many old warnings'. :) Great. I just got an amok running fpc, allocating mem in an endless loop. It's not reproducable. But it's not the first time in the last few weeks. Anything known about it?

The compiler was in an endless loop?

When you run a compiler (or any other program) with debuginfo you can attach (this is also the gdb command) to it with gdb from a different console when the program is already running. For things like endless loops is then usefull to do and then to retrieve the backtrace Peter

Reply by email

Mattias Gaertner
to Peter Vreman
Show quoted text 22 lines
At 20:17 29-5-2004, you wrote: >On Fri, 28 May 2004 23:24:51 +0200 (CEST) "Peter Vreman" > wrote: > > > > > > > The current cvs fpc 1.9.3 gives many new warnings. The following > > > code demonstrates 6 types, where I'm not sure why they now need a > > > warning. Maybe the compiler cracks can tell me, which of them should > > > I report as bugs: > > > > Now they are called 'many old warnings'. > >:) > >Great. > > >I just got an amok running fpc, allocating mem in an endless loop. It's >not reproducable. But it's not the first time in the last few weeks. >Anything known about it? The compiler was in an endless loop?

Yes.

When you run a compiler (or any other program) with debuginfo you can attach (this is also the gdb command) to it with gdb from a different console when the program is already running. For things like endless loops is then usefull to do and then to retrieve the backtrace

It was allocating mem and swap so busily, that the only thing I could do, was to wait, till linux killed it.

Mattias

Reply by email