Recent

Author Topic: Feature request/suggestion  (Read 600 times)

440bx

  • Hero Member
  • *****
  • Posts: 6081
Feature request/suggestion
« on: December 27, 2025, 10:23:08 am »
Hello,

When typecasting pointer types to an integer type, the compiler emits a warning about the conversion being non-portable, which is just fine.

By right clicking on the warning sign found in the gutter, the Lazarus IDE offers three options to hide/remove the warning but, none of the _compiler_ options are to remove the warning _only_ for that occurrence.  The only offered option that removes it _only_ for that occurrence is by inserting an IDE directive (which is obviously dependent on compiling inside the IDE.)

It would be very nice if Lazarus offered a compiler option, independent of the IDE, to disable the warning _only_ for that occurrence.

Removing it only for that occurrence would require pushing the current options, inserting the $warn off before the problem statement and adding $pop immediately after the problem statement.

Please refer to the attachment.

Ideally, the IDE would insert the necessary compiler directives as they appear for the "SeconcField" example in the attachment.

Comments welcome.




FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Feature request/suggestion
« Reply #1 on: December 27, 2025, 11:25:07 am »
I second that. It often makes no sense to disable per unit or globally.
What you suggest, I consider "the proper way".
Good suggestion.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4673
  • I like bugs.
Re: Feature request/suggestion
« Reply #2 on: December 28, 2025, 05:57:02 pm »
440bx, I believe you could implement it yourself. I am sure a patch would be accepted.
See unit etMessageFrame and unit etQuickFixes.
For example code you can search resource string names like lisHideMessageByInsertingIDEDirectiveH and lisHideMessageAtByInsertingIDEDirectiveH.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

440bx

  • Hero Member
  • *****
  • Posts: 6081
Re: Feature request/suggestion
« Reply #3 on: December 28, 2025, 07:13:33 pm »
Someday I hope I can contribute.. so far I'm still working on some of what I consider the basics which is what's causing me to find these bugs.   

ETA:

I realize this is a thread about a request/suggestion but, as a result of it I found a bug related to turning the conversion warning on and off.   I was thinking about that when answering your post.
« Last Edit: December 28, 2025, 07:19:22 pm by 440bx »
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018