Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 04/18/24 in all areas

  1. The first patch for the just released RAD Studio 12.1 Athens is available: RAD Studio 12.1 Athens Patch 1 Available
  2. David Heffernan

    Disabled floating point exceptions are problematic for DLLs

    That's easy to fix. You just make sure that they call internal methods only. Not really. You can store the FPCR to a local variable in the exported method. The thing is, the change in Delphi 12 isn't actually causing any new issues. These issues always existed. It's just a consequence of the "design" of DLLs not making FPCR part of the ABI.
  3. Disappointing, as other Tryxxx routines avoid raising exceptions.
  4. And for convenience, use a global variable to store the state ... gd&r
  5. Elliot Hillary

    DelphiLint v1.0.0 released!

    We're excited to announce the release of DelphiLint v1.0.0, a free and open-source static analyzer and linter for the Delphi IDE! DelphiLint is powered by SonarDelphi, our Delphi analyzer for the SonarQube code quality platform that scans entire codebases with more than 120 different rules. With DelphiLint, the feedback loop is shortened - it allows you to analyze individual files within your editor and correct problems before they're even checked in. GitHub: https://github.com/integrated-application-development/delphilint Release: https://github.com/integrated-application-development/delphilint/releases/tag/v1.0.0 Features Analyze one or more files on demand View detected issues, descriptions, and rationale inline in the Delphi IDE Two analysis modes: Standalone - run analyses entirely locally with a default set of active rules Connected - connect to a SonarQube instance, allowing for Fetching of active rules and configuration from the server's configured quality profiles Suppression of issues that have been resolved in past analyses Usage of the server's version of SonarDelphi Uses the same rules and configuration files as SonarDelphi, making configuration easy for projects that already use SonarDelphi for code quality DelphiLint supports RAD Studio for Delphi 11+. Feedback and contributions are welcome!
  6. Dalija Prasnikar

    Disabled floating point exceptions are problematic for DLLs

    FPCR can be set in a thread safe manner. it is just that Delphi RTL doesn't do that on Windows platform. David has written about it see and https://stackoverflow.com/a/27125657 I have also written about it in my book Delphi Thread Safety Patterns. Working with masked FPU exceptions is the norm across various languages. Also even before Delphi 12, all other Delphi platforms except Windows VCL has masked FPU exceptions. So if you had written FMX application it would have been working the same way it is working now across the board. So the best option is moving to the masked FPU exceptions as this will create the least amount of trouble for the future. Of course, if you are dealing with Delphi built DLLs which don't honor that, you will have to adapt. Another option is to unmask exceptions and proceed as usual, but doing that in multithreaded application is not advisable unless you also patch the RTL as it is not thread-safe. Even having masked FPU exceptions is not thread-safe, but it is much harder to trigger the issue and much easier to avoid RTL API that uses unsafe parts than with unmasked exceptions.
  7. softtouch

    RAD Studio 12.1 Athens Patch 1 Available

    The patch is available via getit, I just installed it.
  8. Bill Meyer

    DelphiLint v1.0.0 released!

    Download the packaged zip for your Delphi version from the latest release, or build from source. Unzip the folder and run the included install.bat script. Done! Well, no. Then I run Delphi 11.3, and get a dialog wanting me to set up external resources. I did start by installing the JRE. The dialog says that, by default, JAVA_HOME is used. But Select override is focused, and wants me to point where? I do not find a JAVA_HOME environment variable, and one might hope that the startup code would solve that for me. I am guessing this wants the location of javaw.exe? Or java.exe? I find no enlightenment on this in the readme on github, either. I am not a Java user, and could wish for a more useful explanation in the dialog. Since my guess proved not to solve the problem, I emphasize the wish for better guidance.
  9. David Heffernan

    Disabled floating point exceptions are problematic for DLLs

    DLLs should take charge of this. They should either make it part of their contract that the host sets the fp control state to a specific state. Or they should set it on entry, and restore it on exit. My DLL does the latter.
  10. Lots of talk not much code... Here is my test type IImplementsStuff = interface(IInterface) ['{83B3CBFA-9854-4BFC-A7B3-A015BE6B8B0B}'] // Interface methods end; [TestFixture] StringUtilsTests = class public [Test] procedure InterFaceToGuid; end; implementation uses SysUtils; procedure StringUtilsTests.InterFaceToGuid; var GUIDStr: string; begin GUIDStr := GetInterfaceGUID(TypeInfo(IImplementsStuff)); Assert.AreEqual('{83B3CBFA-9854-4BFC-A7B3-A015BE6B8B0B}',GUIDStr); end; Here is my implementation: function GetInterfaceGUID(const TypeInfo: PTypeInfo): string; var TypeData: PTypeData; GUID: TGUID; begin Result := ''; if TypeInfo.Kind = tkInterface then begin TypeData := GetTypeData(TypeInfo); // Correctly handle the conversion from byte array to TGUID Move(TypeData.IntfGuid, GUID, SizeOf(TGUID)); Result := GUIDToString(GUID); end else raise Exception.Create('Provided type is not an interface'); end; Hope it helps you as well as anyone else who needs it
×