{$WARNINGS/HINTS/NOTES OFF} does not reset at end of unit
Original Reporter info from Mantis: Craig Peterson @boramis
-
Reporter name: Craig Peterson
Original Reporter info from Mantis: Craig Peterson @boramis
- Reporter name: Craig Peterson
Description:
The {WARNINGS OFF}, {
HINTS OFF}, and {$NOTES OFF}
directives affect all subsequently compiled units as well, rather than resetting to the global state at the end of the current file.
Steps to reproduce:
Compile this sample code with "fpc Test.dpr". As is there are two notes:
Unit1.pas(10,3) Note: Local variable "Var1" not used
Unit2.pas(8,3) Note: Local variable "Var2" not used
If you add "{$NOTES OFF}" to the Unit1 implementation section, both notes disappear. Adding it to the Unit2 implementation section instead makes it only disappear for that unit, so the compilation order matters. Affects all of $WARNINGS/HINTS/NOTES.
Sample code:
---- Test.dpr ------
program Test;
uses
Unit1 in 'Unit1.pas',
Unit2 in 'Unit2.pas';
begin
end.
---- Unit1.pas -----
unit Unit1;
interface
implementation
var
Var1: Boolean;
end.
---- Unit2.pas -----
unit Unit2;
interface
implementation
var
Var2: Boolean;
end.
Mantis conversion info:
- Mantis ID: 27378
- Version: 3.1.1
- Fixed in version: 3.3.1
- Fixed in revision: 40750 (#04bbfd17)