Does not compile with Typed Pointers on

Issue #50 resolved
Arioch The created an issue

XE2 Win32

In $T+ mode the library does not compile.

This makes problematic compiling projects using pointers with type safety that use this library. Either i should only include DCUs folder into search path, which means i can not more trace into s4d sources, which makes learning API and datastructures more difficult, or (if i include s4d sources path to the project search dirs list) i should disable type safety for the whole project.

I think that, as many other projects do, s4d should explicitly have all the critical compiler switches explicitly set in spring4d.inc file or any other similar file, that is included into all files of the sources. That said, the quantity of crytical switch better be minimized, and i think compilation in type safety mode would be nice to have, turning implied unsafe pointer casts into explicit ones.

Comments (4)

  1. Stefan Glienke repo owner

    Being able to step through the source has nothing to do with explicitly including units to your projects. Add the debug dcu folder to your library path and the source path to your browsing path and you are done.

    Anyway since Spring.inc is included in every unit anyway it won't hurt to add these switches there. What are the critical compiler switches you have in mind?

    I guess this? {$T-,X+,H+,B-}

  2. Arioch The reporter

    I'd prefer to add safety and make it $T+ though, but those are my personal options.

    Thank you for hint with debug DCU and browsing path. What i would like, if it possible, to achieve, is making Ctrl+Click and "Find Declaration" work, while making debugger tracing not step into s4d sources. Is it even possible ?

    I did not made debug dcu for exactly that reason, i am not s4d developer, except my old x64 asm stubs for crypto, so i'd prefer not to go into it.

  3. Stefan Glienke repo owner

    Making it $T+ would just require several hardcasts. Also the default option is off. When adding to the inc file you can do as you like for your own code anyway.

    Ctrl+Click is some kind of mystery that I have not solved completely. It is related to certain debug symbols included in the dcus but not those that make the debugger step into these files (aka blue dots). See the {$DEFINITIONINFO ON} in Spring.inc. However it fails to work sometimes. Generations of Delphi developers are scratching their heads when it works and when not...

    I also just found out that I have to add the inc file before the very first line of the unit to be able to ctrl+click on the unit in a project to go into it. But if you are in some of the Spring units you cannot ctrl+click on a unit in the uses to navigate there.

  4. Log in to comment