[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] what happens in case of overflow?
From: |
Sergey Kashyrin |
Subject: |
Re: [open-cobol-list] what happens in case of overflow? |
Date: |
Thu Jan 26 09:23:01 2006 |
Jose,
It depends on compatibility options / dialect:
G:\skatests\cobol>cobc -x zrun3.cbl
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cob7A77.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/out:zrun3.exe
zrun3.obj
g:\open-cobol\build_windows\x64\debug\libcob.lib
g:\open-cobol\build_windows\x64\debug\gmp.lib
G:\skatests\cobol>zrun3
x = 9
x after the add = 9
G:\skatests\cobol>cobc -x -std=mf zrun3.cbl
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cob7A7A.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/out:zrun3.exe
zrun3.obj
g:\open-cobol\build_windows\x64\debug\libcob.lib
g:\open-cobol\build_windows\x64\debug\gmp.lib
G:\skatests\cobol>zrun3
x = 9
x after the add = 0
----- Original Message -----
From: "Jose Vilmar Estacio de Souza" <address@hidden>
To: <address@hidden>
Sent: Thursday, January 26, 2006 11:59 AM
Subject: [open-cobol-list] what happens in case of overflow?
Hi all.
I've the following program:
------
identification division.
program-id. t4.
environment division.
data division.
working-storage section.
77 x pic 9(1) value 9.
procedure division.
display "x = " x
add 1 to x
display "x after the add = " x
stop run.
------
Executing the program I receive the following result:
$ ./t4
x = 9
x after the add = 9
$
When executing the same program in my old micro focus cobol environment, I'm
receiving the following result:
$ cobrun t4
x = 9
x after the add = 0
$
Thanks.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list