Hi, Could it be correct that there's a bug in Delphi7 where the compiler directive {$Q-} and {$Q+} works completely the opposite? When trying to build an existing Delhi 7 project in Delphi 2010 i found this weird behaviour. In D7 {$Q-} set overflow cheking on and in Delphi 2010 off ????? Regards, Arno Brinkman ABVisie -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Firebird open source database with many powerful SQL features: http://www.firebirdsql.org http://www.firebirdsql.info General database developer support: http://www.databasedevelopmentforum.com Support list for Interbase and Firebird users: firebird-support@yahoogroups.com Nederlandse firebird nieuwsgroep: news://newsgroups.firebirdsql.info
![]() |
0 |
![]() |
Arno Brinkman wrote: > Could it be correct that there's a bug in Delphi7 where the compiler > directive {$Q-} and {$Q+} works completely the opposite? Assuming D7 build 8.1, not very likely. > When trying to build an existing Delhi 7 project in Delphi 2010 i > found this weird behaviour. In D7 {$Q-} set overflow cheking on and > in Delphi 2010 off ????? Could it be that you use include files where overflow checking is turned on/off based on VERxxx defines and that you did not include the VER210 yet? -- Pieter 'That seems to point up a significant difference between Europeans and Americans. A European says: "I can't understand this, what's wrong with me?" An American says: "I can't understand this, what's wrong with him?"' -- Terry Pratchett
![]() |
0 |
![]() |
Hello Pieter, >> Could it be correct that there's a bug in Delphi7 where the compiler >> directive {$Q-} and {$Q+} works completely the opposite? > > Assuming D7 build 8.1, not very likely. Yes, that build. >> When trying to build an existing Delhi 7 project in Delphi 2010 i >> found this weird behaviour. In D7 {$Q-} set overflow cheking on and >> in Delphi 2010 off ????? > > Could it be that you use include files where overflow checking is > turned on/off based on VERxxx defines and that you did not include the > VER210 yet? I can very easy reproduce this. Simple make a new application in Delphi 7. Drop a button on the form, double click and enter this code there: procedure TForm1.Button1Click(Sender: TObject); var lTotal, lIndex: Integer; begin {$OVERFLOWCHECKS OFF} lTotal := 0; for lIndex := 1 to 20 do begin lTotal := (131 * lTotal) + 97; end; lTotal := Abs(lTotal); {$OVERFLOWCHECKS ON} end; Save the project and run the application in Delphi 7, i get an overflow error. Reopen the application in Delphi 2010 and no overflow error. Regards, Arno Brinkman ABVisie -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Firebird open source database with many powerful SQL features: http://www.firebirdsql.org http://www.firebirdsql.info General database developer support: http://www.databasedevelopmentforum.com Support list for Interbase and Firebird users: firebird-support@yahoogroups.com Nederlandse firebird nieuwsgroep: news://newsgroups.firebirdsql.info
![]() |
0 |
![]() |
"Arno Brinkman" wrote: > I can very easy reproduce this. > Simple make a new application in Delphi 7. > Drop a button on the form, double click and enter this code there: > > procedure TForm1.Button1Click(Sender: TObject); > var > lTotal, lIndex: Integer; > begin > {$OVERFLOWCHECKS OFF} > lTotal := 0; > for lIndex := 1 to 20 do > begin > lTotal := (131 * lTotal) + 97; > end; > lTotal := Abs(lTotal); > {$OVERFLOWCHECKS ON} > end; > > > Save the project and run the application in Delphi 7, i get an > overflow error. > > Reopen the application in Delphi 2010 and no overflow error. Arno, I can confirm that Q+ and Q- are inverted in operation also in D2005. Looking at the disassembly, there are JNO:s in the Q- state and not in the Q+ state. Regards Tom
![]() |
0 |
![]() |
Arno Brinkman wrote: > > Assuming D7 build 8.1, not very likely. > > Yes, that build. > > > > When trying to build an existing Delhi 7 project in Delphi 2010 i > > > found this weird behaviour. In D7 {$Q-} set overflow cheking on > > > and in Delphi 2010 off ????? > > > > Could it be that you use include files where overflow checking is > > turned on/off based on VERxxx defines and that you did not include > > the VER210 yet? > > I can very easy reproduce this. > Simple make a new application in Delphi 7. > Drop a button on the form, double click and enter this code there: > > procedure TForm1.Button1Click(Sender: TObject); > var > lTotal, lIndex: Integer; > begin > {$OVERFLOWCHECKS OFF} > lTotal := 0; > for lIndex := 1 to 20 do > begin > lTotal := (131 * lTotal) + 97; > end; > lTotal := Abs(lTotal); > {$OVERFLOWCHECKS ON} > end; > > > Save the project and run the application in Delphi 7, i get an > overflow error. Indeed strange when you use them inside a method the effect seems to be reversed. Moving them outside the method should work OK. > Reopen the application in Delphi 2010 and no overflow error. So whatever the cause was, it looks like this is fixed in the later versions. -- Pieter "Let's not bring age into this discussion. I will not let my opponent's youth and inexperience become an issue." -- Ronald Reagan on Walter Mondale ...
![]() |
0 |
![]() |
Hi, >> Save the project and run the application in Delphi 7, i get an >> overflow error. > > Indeed strange when you use them inside a method the effect seems to be > reversed. Moving them outside the method should work OK. > >> Reopen the application in Delphi 2010 and no overflow error. > > So whatever the cause was, it looks like this is fixed in the later > versions. Yes, but because we share code between projects we need to solve it by IFDEFs VERxxx. Something for in the "notes or gotchas when converting to D2010" list :-) Result can be worser then you think, cause when you expect error when an overflow happens, it doesn't happen... Regards, Arno Brinkman ABVisie -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Firebird open source database with many powerful SQL features: http://www.firebirdsql.org http://www.firebirdsql.info General database developer support: http://www.databasedevelopmentforum.com Support list for Interbase and Firebird users: firebird-support@yahoogroups.com Nederlandse firebird nieuwsgroep: news://newsgroups.firebirdsql.info
![]() |
0 |
![]() |