View Issue Details

IDProjectCategoryView StatusLast Update
0036628LazarusIDEpublic2020-01-27 14:59
ReporternanobitAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Platformwin32OSWindowsOS Version10
Product Version2.0.4Product Build 
Target VersionFixed in Version 
Summary0036628: {$warn xxx error} helpfulness suboptimal
Description"Fatal: Compilation aborted" is not enough information.

After compile abortion due to the promoted warning:
Source line and error code are not obvious from the compile messages,
but only the generic "Fatal: Compilation aborted" at the list-end is obvious.

The messages list includes the error source (warning),
but programmers need to guess and select one from the whole list,
wherein "all" other messages (source locations) are unrelated to this error.
Steps To ReproduceExample which produces fatal error:

{$warn 4045 error}
const negValue = -1;
var dw: dword;
...
if (negValue <> dw) then; // "Warning: Comparison might be always true ..."
Additional InformationFPC 3.2
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetWin32/Win64
Attached Files

Activities

Marco van de Voort

2020-01-25 20:11

manager   ~0120737

Right click anywhere in the messages listbox, and select "filter non urgent messages" and set it to "none".

nanobit

2020-01-25 20:50

reporter   ~0120738

It seems not possible to solve this with filters,
it remains unclear which message is referred to by the (generic) fatal error.
The longer the list, the greater the challenge.

Furthermore, there should be a solution without changing filters,
for example, halt at the specific message.

Martin Friebe

2020-01-25 21:14

manager   ~0120740

This is the output:
Free Pascal Compiler version 3.3.1 [2020/01/24] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
(1002) Target OS: Win32 for i386
(3104) Compiling foo/project1.lpr
foo/project1.lpr(8,10) Warning: (5037) Variable "a" does not seem to be initialized
foo/project1.lpr(8,8) Error: (4045) Comparison might be always true due to range of constant and expression
project1.lpr(13) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted

And then Error: ppc386.exe returned an error exitcode
There is nothing in that output that connects the "Fatal" error, to the 4045 error.
If this is an issue, consider a 2nd report towards Fpc. Keeping this report for the below.

---------
However there is an IDE issue.

     The IDE displays a warning, for the 4045 message. But fpc declared it as error.

If that were fixed, then you had 2 errors in the message window.
- One that points to the issue
- And one that still has line info.

nanobit

2020-01-25 22:23

reporter   ~0120743

Yes, the IDE should mark the specific message as error and the confusion is gone.
And the second (unspecific fatal) message can be removed,
but could also be tolerated (if removal is not simple)

Sven Barth

2020-01-27 14:59

manager   ~0120778

The unspecific message has a purpose as well. If you compile code with many warnings, hints and maybe one error you'll see that an error occurred nevertheless (especially important when not working with an IDE).

Issue History

Date Modified Username Field Change
2020-01-25 20:09 nanobit New Issue
2020-01-25 20:11 Marco van de Voort Note Added: 0120737
2020-01-25 20:50 nanobit Note Added: 0120738
2020-01-25 21:14 Martin Friebe Note Added: 0120740
2020-01-25 22:23 nanobit Note Added: 0120743
2020-01-27 14:59 Sven Barth Note Added: 0120778