* * *

Author Topic: "Error: Message recordind not yet supported" if certain hints/warnings disabled  (Read 1823 times)

hayanninja

  • New member
  • *
  • Posts: 45
Lazarus 1.8.0 with FPC 3.0.4, running on Windows 10 64-bit.

In a few cases throughout my project, I have event handler procedures that have arguments that don't get used in the procedures. To keep the compiler output tidy, I usually surround these with {$warn 5024 off} (and on again afterwards). I don't want to just leave it off for the whole project, but rather, specifically disable it during code that I know has unused parameters and isn't meant to be using them.

Adding it on some methods, however, gives a "Error: Message recordind not yet supported" compiler error. I'm not really noticing any pattern as such of what will or won't cause this. The error is never on the block inside the {$warn 5024 off} section, but on other methods later in the file - usually if the error occurs, it occurs on almost every method in the rest of the file. It doesn't seem to ever affect other units. In some cases, using {$hints off} (and on) instead will compile without problem.

The same code, except without the warning toggles, compiles without issue.

Can confirm this issue also happens on Mac OS X, same Lazarus and FPC version, 32-bit compiler.
« Last Edit: January 25, 2018, 12:04:09 pm by hayanninja »

hayanninja

  • New member
  • *
  • Posts: 45
I'm happy to provide my code to FPC / Lazarus developers if it will help, but do not wish to release it publicly at this point in time.

GetMem

  • Hero Member
  • *****
  • Posts: 3195
@hayanninja

Please read this: http://wiki.freepascal.org/Turn_warnings_and_hints_on_or_off . Hints can be disabled/ignored but never ignore a warning.

hayanninja

  • New member
  • *
  • Posts: 45
5024 is a hint, not a warning - specifically, that a local variable is never used. It appears however the correct syntax to disable it (temporarily) is still {$warn 5024 off} rather than {$hint 5024 off}.

And nonetheless, whether or not turning them off is advised against, code that compiles fine with them enabled then not compiling with the sole addition of a warning off and on tag, is a bug.

Thaddy

  • Hero Member
  • *****
  • Posts: 6898
Indeed {$warn xxxx on/off} syntax is both for hints and warnings
But I suggest to always use it like this:
Code: Pascal  [Select]
  1. {$push}{$warn 5024 off}
  2. .....
  3. {$pop}

I wrote a wiki entry for this last year. http://wiki.freepascal.org/Turn_warnings_and_hints_on_or_off

As I wrote, it has to surround a block of code, maybe that's what's wrong.
You do it like this:
Code: Pascal  [Select]
  1. // not here!!!
  2. procedure withunusedparameter(const testme:integer);
  3. {$push}{$warn 5024 off} //but here <-------
  4. begin  
  5. // not here!! unless surrounding another block or full statement.
  6. end;
  7. {$pop} //and here..<-------

Florian explained this on the bugtracker.
« Last Edit: January 25, 2018, 01:22:23 pm by Thaddy »
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

hayanninja

  • New member
  • *
  • Posts: 45
If I both move it around the begin...end block *and* add the push-pop, it no longer causes that error. This still seems like quite a major bug overall, though...

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus