-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COMP-X displayed with number of characters from maximum value #205
base: gcos4gnucobol-3.x
Are you sure you want to change the base?
COMP-X displayed with number of characters from maximum value #205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder on the need of the compx_size attribute and the field's alphanumeric category...
cobc/typeck.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of those changes are either unnecessary or at the wrong place - CB_USAGE_COMP_X
is never to be of CB_CATEGORY_ALPHANUMERIC
(only it's ->pic
could) but has always to be CB_CATEGORY_NUMERIC
.
@@ -914,6 +914,7 @@ struct cb_field { | |||
int size; /* Field size */ | |||
int level; /* Level number */ | |||
int memory_size; /* Memory size */ | |||
int compx_size; /* Original COMP-X byte size */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just use f->pic->size for this rarely used definition, instead of adding an extra field to all variables?
Hi Simon, |
Thanks Emilien, I do understand the approach, but question if the solution in the rw-branch (which was later merged to pangea which later became the new trunk = GC4) was the correct thing to do in the first place. In any case - please inspect the real commit here - r614. Question: is there a reason to not use the testcase from the original commit instead of the new one (=misses it something)? |
I had the tests before editing the code, so I used it to validate the changes and it seemed to me that the other test did more than just check for the display value. Thinking about it again the original test should be used so everything from it is tested again. |
This is now taking only changes from r614, once again I think this is the way to go for an easier merge of later commits that uses what r614 changed |
This PR merges all the changes from svn 2926 and a few lines from 3064.
Based on the discussion started with #147 (comment)
When a
COMP-X
value is only one byte long, we always display a 3 character long character (as one byte can display integer up to255
)