Recent

Author Topic: compiler messages suggestion/feature request  (Read 1140 times)

440bx

  • Hero Member
  • *****
  • Posts: 4344
compiler messages suggestion/feature request
« on: June 16, 2024, 10:18:11 am »
Hello,

I normally get hundreds upon hundreds of compiler messages when compiling a project.

There are so many messages that it becomes impractical to review them.

I'd like Lazarus to sort the messages by type, that is, group all the "hints" together, "Notes" together, "Warnings" together.   and within each group sort by line number (that can be accomplished simply by aligning the messages then sorting the text starting at the alignment column (very simple sort.)

Also, the compiler stuff that is at the top would be nice to have at the bottom.  Just FYI, I had to delete a good number of messages because with all the messages the post exceeds the maximum number of characters.

Comments welcome.

Here is the output of what I'd like to see from Lazarus:
Code: Text  [Select][+][-]
  1. Free Pascal Compiler version 3.2.2-r0d122c49 [2024/03/17] for x86_64
  2. Copyright (c) 1993-2021 by Florian Klaempfl and others
  3. (1021) 17 warning(s) issued
  4. (3104) Compiling ZydisInfoG.lpr
  5. (3104) Compiling ErrorHandler.pas
  6. (3104) Compiling winapi.pas
  7. (1002) Target OS: Win64 for x64
  8. (1022) 155 hint(s) issued
  9. (3104) Compiling winmessages.pas
  10. (3104) Compiling Zydis.pas
  11. (3104) Compiling Resource.pas
  12. (9015) Linking H:\Dev\ZyDis\ZydisInfo\ZydisInfoG\ZydisInfoG.x64.exe
  13. (1008) 77940 lines compiled, 1.3 sec, 109728 bytes code, 5172 bytes data
  14. (1023) 76 note(s) issued
  15.  
  16. <filename>  Hint: (4055) Conversion between ordinals and pointers is not portable
  17. <filename>  Hint: (4055) Conversion between ordinals and pointers is not portable
  18. <filename>  Hint: (4055) Conversion between ordinals and pointers is not portable
  19. <filename>  Hint: (4055) Conversion between ordinals and pointers is not portable
  20. <filename>  Hint: (4055) Conversion between ordinals and pointers is not portable
  21. <filename>  Hint: (5024) Parameter "InIID" not used
  22. <filename>  Hint: (5024) Parameter "InKeyState" not used
  23. <filename>  Hint: (5024) Parameter "InParamL" not used
  24. <filename>  Hint: (5024) Parameter "OutObj" not used
  25. <filename>  Hint: (5028) Local absolutevar "AccessedFlagsMask" is not used
  26. <filename>  Hint: (5028) Local absolutevar "Address" is not used
  27. <filename>  Hint: (5028) Local absolutevar "AlignTo" is not used
  28. <filename>  Hint: (5028) Local absolutevar "Dc" is not used
  29. <filename>  Hint: (5028) Local absolutevar "Decoder" is not used
  30. <filename>  Hint: (5028) Local absolutevar "FlagIdx" is not used
  31. <filename>  Hint: (5028) Local absolutevar "FlagsSectionMetrics" is not used
  32. <filename>  Hint: (5028) Local absolutevar "Font" is not used
  33. <filename>  Hint: (5028) Local absolutevar "FormatterStyle" is not used
  34. <filename>  Hint: (5028) Local absolutevar "HeadingId" is not used
  35. <filename>  Hint: (5028) Local absolutevar "HeadingLine" is not used
  36. <filename>  Hint: (5028) Local absolutevar "Instruction" is not used
  37. <filename>  Hint: (5028) Local absolutevar "Instruction" is not used
  38. <filename>  Hint: (5028) Local absolutevar "InstructionBytes" is not used
  39. <filename>  Hint: (5028) Local absolutevar "InstructionBytesDistances" is not used
  40. <filename>  Hint: (5028) Local absolutevar "InstructionCharsMetrics" is not used
  41. <filename>  Hint: (5028) Local absolutevar "InstructionIndexSequential" is not used
  42. <filename>  Hint: (5028) Local absolutevar "InstructionLine" is not used
  43. <filename>  Hint: (5028) Local absolutevar "InstructionsTbl" is not used
  44. <filename>  Hint: (5028) Local absolutevar "InstructionsTbl" is not used
  45. <filename>  Hint: (5028) Local absolutevar "InstructionsUniqueIndex" is not used
  46. <filename>  Hint: (5028) Local absolutevar "InstructionsUniqueIndexCount" is not used
  47. <filename>  Hint: (5028) Local absolutevar "ModuleAddress" is not used
  48. <filename>  Hint: (5028) Local absolutevar "NtHeadersAddress32" is not used
  49. <filename>  Hint: (5028) Local absolutevar "Operands" is not used
  50. <filename>  Hint: (5028) Local absolutevar "OperandsSectionMetrics" is not used
  51. <filename>  Hint: (5028) Local absolutevar "OutputPoint" is not used
  52. <filename>  Hint: (5028) Local absolutevar "OutputSegmentLabels" is not used
  53. <filename>  Hint: (5028) Local absolutevar "PaintResources" is not used
  54. <filename>  Hint: (5028) Local absolutevar "PaintedLinesCount" is not used
  55. <filename>  Hint: (5028) Local absolutevar "PaintedLinesCount" is not used
  56. <filename>  Hint: (5028) Local absolutevar "PaintedLinesCount" is not used
  57. <filename>  Hint: (5028) Local absolutevar "PaintedLinesCount" is not used
  58. <filename>  Hint: (5028) Local absolutevar "PeData" is not used
  59. <filename>  Hint: (5028) Local absolutevar "PeData" is not used
  60. <filename>  Hint: (5028) Local absolutevar "PeData" is not used
  61. <filename>  Hint: (5028) Local absolutevar "PeData" is not used
  62. <filename>  Hint: (5028) Local absolutevar "ProgramData" is not used
  63. <filename>  Hint: (5028) Local absolutevar "ProgramData" is not used
  64. <filename>  Hint: (5028) Local absolutevar "ProgramData" is not used
  65. <filename>  Hint: (5028) Local absolutevar "ProgramData" is not used
  66. <filename>  Hint: (5028) Local absolutevar "RuntimeFunctions" is not used
  67. <filename>  Hint: (5028) Local absolutevar "RuntimeFunctionsTable" is not used
  68. <filename>  Hint: (5028) Local absolutevar "RuntimeFunctionsTableCount" is not used
  69. <filename>  Hint: (5028) Local absolutevar "SegmentName" is not used
  70. <filename>  Hint: (5028) Local absolutevar "SegmentOutputPoint" is not used
  71. <filename>  Hint: (5028) Local absolutevar "Source" is not used
  72. <filename>  Hint: (5028) Local absolutevar "SourceTable" is not used
  73. <filename>  Hint: (5028) Local absolutevar "SourceTable" is not used
  74. <filename>  Hint: (5028) Local absolutevar "SourceTable" is not used
  75. <filename>  Hint: (5028) Local absolutevar "Token" is not used
  76. <filename>  Hint: (5028) Local absolutevar "WM_MOUSEWHEEL_PARAM_L" is not used
  77. <filename>  Hint: (5028) Local absolutevar "WindowClass" is not used
  78. <filename>  Hint: (5028) Local absolutevar "Wnd" is not used
  79. <filename>  Hint: (5028) Local absolutevar "X" is not used
  80. <filename>  Hint: (5028) Local absolutevar "ZydisInfo" is not used
  81. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  82. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  83. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  84. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  85. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  86. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  87. <filename>  Hint: (5028) Local absolutevar "dc" is not used
  88. <filename>  Hint: (5028) Local const "COLOR_TYPECAST" is not used
  89. <filename>  Hint: (5028) Local const "LABEL_INTEL_ABSOLUTE" is not used
  90. <filename>  Hint: (5028) Local const "LABEL_INTEL_INVARIANT" is not used
  91. <filename>  Hint: (5028) Local const "LABEL_INTEL_RELATIVE" is not used
  92. <filename>  Hint: (5028) Local const "LABEL_UNUSED_ACCEPTS_REPE" is not used
  93. <filename>  Hint: (5028) Local const "LABEL_UNUSED_ACCEPTS_REPNE" is not used
  94. <filename>  Hint: (5028) Local const "LABEL_UNUSED_HAS_REPE" is not used
  95. <filename>  Hint: (5028) Local const "LABEL_UNUSED_HAS_REPNE" is not used
  96. <filename>  Hint: (5028) Local const "SUB_ESP_NUMBER" is not used
  97. <filename>  Hint: (5028) Local const "color_aqua_bright4" is not used
  98. <filename>  Hint: (5028) Local const "color_pink_bright5" is not used
  99. <filename>  Hint: (5028) Local const "color_pink_bright8" is not used
  100. <filename>  Hint: (5028) Local const "color_purple_bright5" is not used
  101. <filename>  Hint: (5028) Local proc "PrintTokenizedInstruction" is not used
  102. <filename>  Hint: (5028) Local proc "ZYAN_BITS_TO_REPRESENT" is not used
  103. <filename>  Hint: (5028) Local proc "ZYAN_MAKE_STATUS" is not used
  104. <filename>  Hint: (5028) Local type "PATTRIBUTES_MAP" is not used
  105. <filename>  Hint: (5028) Local type "TINSTRUCTION_INPUT" is not used
  106. <filename>  Note: (3031) Values in enumeration types have to be ascending
  107. <filename>  Note: (3031) Values in enumeration types have to be ascending
  108. <filename>  Note: (3031) Values in enumeration types have to be ascending
  109. <filename>  Note: (3031) Values in enumeration types have to be ascending
  110. <filename>  Note: (5027) Local variable "AbsoluteAddress" is assigned but never used
  111. <filename>  Note: (5027) Local variable "CodeNext" is assigned but never used
  112. <filename>  Note: (5027) Local variable "FilenameLen" is assigned but never used
  113. <filename>  Note: (5027) Local variable "FilenameLen" is assigned but never used
  114. <filename>  Note: (5027) Local variable "Offset" is assigned but never used
  115. <filename>  Note: (5027) Local variable "PatternSize" is assigned but never used
  116. <filename>  Note: (5027) Local variable "Status" is assigned but never used
  117. <filename>  Note: (5027) Local variable "ThreadId" is assigned but never used
  118. <filename>  Note: (5027) Local variable "buf" is assigned but never used
  119. <filename>  Note: (5027) Local variable "hr" is assigned but never used
  120. <filename>  Note: (5027) Local variable "hr" is assigned but never used
  121. <filename>  Note: (5027) Local variable "i" is assigned but never used
  122. <filename>  Note: (5027) Local variable "sprintf_buffer" is assigned but never used
  123. <filename>  Warning: (4044) Comparison might be always false due to range of constant and expression
  124. <filename>  Warning: (4044) Comparison might be always false due to range of constant and expression
  125. <filename>  Warning: (4044) Comparison might be always false due to range of constant and expression
  126. <filename>  Warning: (4110) range check error while evaluating constants (2147942487 must be between -2147483648 and 2147483647)
  127. <filename>  Warning: (4110) range check error while evaluating constants (2147942487 must be between -2147483648 and 2147483647)
  128. <filename>  Warning: (5036) Local variable "Y" does not seem to be initialized
  129. <filename>  Warning: (5036) Local variable "Y" does not seem to be initialized
  130. <filename>  Warning: (5036) Local variable "Y" does not seem to be initialized
  131. <filename>  Warning: (5036) Local variable "Y" does not seem to be initialized
  132. <filename>  Warning: (5036) Local variable "Y" does not seem to be initialized
  133. <filename>  Warning: (5036) Local variable "Y" does not seem to be initialized
  134. <filename>  Warning: (5037) Variable "OutFlagsSectionMetrics" does not seem to be initialized
  135. <filename>  Warning: (5037) Variable "OutInstructionIndexSequential" does not seem to be initialized
  136. <filename>  Warning: (5037) Variable "OutInstructionsOptimizedIndex" does not seem to be initialized
  137. <filename>  Warning: (5037) Variable "OutInstructionsTbl" does not seem to be initialized
  138. <filename>  Warning: (5037) Variable "OutInstructionsUniqueIndex" does not seem to be initialized
  139.  

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 7119
Re: compiler messages suggestion/feature request
« Reply #1 on: June 16, 2024, 08:49:47 pm »
Use Lazbuild and filter the output using Perl. https://github.com/MarkMLl/fpclaz_build_scripts does something vaguely similar, in the context of finding where each source file is.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 15204
  • Censorship about opinions does not belong here.
Re: compiler messages suggestion/feature request
« Reply #2 on: June 16, 2024, 09:06:38 pm »
We don't need perl for that, we have supersort, which does that trick.
Of course the national anthem of the U.S.A. was written by Jimi Hendrix, didn't you know that?

440bx

  • Hero Member
  • *****
  • Posts: 4344
Re: compiler messages suggestion/feature request
« Reply #3 on: June 16, 2024, 09:12:07 pm »
Use Lazbuild and filter the output using Perl.
The problem with "outside solutions" such as using Perl is that you can no longer click on the message to have Lazarus display the line in the editor window.  IOW, making any corrections to the code becomes laborious.

That's the problem with the current output.  The unorganized pile of messages makes it really time consuming to inspect the messages in order to determine which ones need attention.  Having the messages grouped by "severity"/type would really help.  Another thing that would help enormously would be to have the text of the messages left justified.  This would require determining the widest/longest filename but it's easy and only a minimal amount of additional work.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5589
  • Compiler Developer
Re: compiler messages suggestion/feature request
« Reply #4 on: June 16, 2024, 09:55:43 pm »
I'd like Lazarus to sort the messages by type, that is, group all the "hints" together, "Notes" together, "Warnings" together.   and within each group sort by line number (that can be accomplished simply by aligning the messages then sorting the text starting at the alignment column (very simple sort.)

Please note that there are sometimes occations that a followup, but related message has a different verbosity: E.g. when you have multiple overloads available the message that an overload could not be determined will have verbosity error and the followup list of found candidates will have verbosity hint.
This could lead to confusion, so this should at least not be done by default. Or maybe it could be done with category speed buttons so that one can enable/disable certain verbosities? So if you want to only see warnings you could simply disable all other verbosities?

440bx

  • Hero Member
  • *****
  • Posts: 4344
Re: compiler messages suggestion/feature request
« Reply #5 on: June 16, 2024, 10:19:44 pm »
Please note that there are sometimes occations that a followup, but related message has a different verbosity: E.g. when you have multiple overloads available the message that an overload could not be determined will have verbosity error and the followup list of found candidates will have verbosity hint.
This could lead to confusion, so this should at least not be done by default. Or maybe it could be done with category speed buttons so that one can enable/disable certain verbosities? So if you want to only see warnings you could simply disable all other verbosities?
I think you exposed an interesting possibility but, I think that most developers would focus on the errors first and recompile until there are no errors reported and only after there are no errors are the other messages inspected. 

At least, that's the way I do it.  Whenever I see errors, I take care of those first, ignoring everything else.  Once the errors are gone then I look at the remaining messages.

I am in complete agreement that having the messages arranged in the way I am requesting/suggestion should be a user-controlled option using some mechanism - category speed buttons sounds good to me.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018