Forum > General
Compiler: {$INCLUDE %DATE%} turns on IO Checking?
AlanTheBeast:
Hope nobody has tried to test my earlier assertion. Editing goofs led me down a path....
I have a section of code set to {$I-} as I check IOResult.
I added the line:
S := {$INCLUDE %DATE%}+'::'+{$INCLUDE %TIME%};
to be able to print out the program compiled date/time.
And IOChecking is turned on again!
(Added {$I-} after the above to mitigate, but this seems like a doozy of an error in the compiler...?)
FPC: Free Pascal Compiler version 3.2.0 [2020/05/31] for x86_64
MarkMLl:
I've not seen that but I usually put them in constants first, like
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---CONST manifestDate= (*$I %DATE% *) ; manifestTime= (*$I %TIME% *) ;
MarkMLl
AlanTheBeast:
Good idea. I'll implement it that way.
But - I was wrong about my earlier assertion of it the $INCLUDE causing IO checking to be turned on
MarkMLl:
Yes, but /why/? What had happened?
It does raise the interesting question about whether the state of any particular setting can be checked: ISTR that there is an IFOPT for some but not all, and $I is sufficiently overloaded that it could be problematic.
MarkMLl
AlanTheBeast:
--- Quote from: MarkMLl on July 02, 2022, 10:50:24 pm ---Yes, but /why/? What had happened?
--- End quote ---
I was changing some of the top of the file options and testing LOOPUNROLL for S&G (looking at the generated assembler - it is, in some instances, well worth it).
At some point I clobbered the existing {$I-} w/o realizing it.
--- Quote from: MarkMLl on July 02, 2022, 10:50:24 pm ---It does raise the interesting question about whether the state of any particular setting can be checked: ISTR that there is an IFOPT for some but not all, and $I is sufficiently overloaded that it could be problematic.
--- End quote ---
I personally wouldn't be offended if all pragmas were in long form only from some point in the compiler evolution.
Force everyone to update their code too (or have a competition to write the best auto-fixer).
It is now officially beer time. G'night.
Navigation
[0] Message Index
[#] Next page