0

well, I work on developing a software that is still compiled in Delphi 7, and our team got some errors that were caused by variable that wasn't initialized. So we decided to force a compilation error if the Delphi 7 finds a variable like this, to avoid future errors.

But, the problem is that I didn't found any option about it in Delphi 7, I know that Delphi XE or later has this option.

Do you know some plugin or anything else that can help me on it? It can be some to force a compilation error or find all variable that wasn't initialized on the Project.

  • Well, that's not possible cuz a lot of components aren't installed on Delphi XE, most of them are incompatible. Maybe a Syntax Check could help me, idk. – Michael Marcel Jun 30 '21 at 15:10
  • 2
    Just tell the devs that their code must produce zero warnings when compiled. – Olivier Jun 30 '21 at 15:11
  • 4
    No need for such option: compiling a project should **never** produce any warning. Every warning has to be fixed before continuing. – fpiette Jun 30 '21 at 15:36
  • D'accord: see [Why treat warnings as errors? They are just warnings!](https://stackoverflow.com/a/57842757/4299358) and [Is it a good idea to eliminate compiler warnings?](https://stackoverflow.com/q/512222/4299358) – AmigoJack Jun 30 '21 at 15:52

1 Answers1

1

i dont have a Delphi 7 at hand. I hope the Directives from the Link work.

So, if your having anly a few Warnings you should enable "Treat warnings as error". (i dont know where that in d7 is, but i believe even d5 had this)

Option Error as Warning Delphi 2009 where is the 'treat warnings as errors' option?

Hidden Error/Warning Options https://marc.durdin.net/2012/05/delphi-xe2s-hidden-hints-and-warnings-options/

(untested: Perhaps you can even define except Warnings in d7. For XE see Tools-Debugger Options-Embarcadero Debuggers-Language Exceptions)