comp-5-uses-binary-byteorder dialect configuration option #249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: comp-5-uses-binary-byteorder dialect configuration option
Summary
This branch adds a new dialect configuration option which allows COMP-5 fields to be processed using the same byte order as BINARY fields.
Motivation
Previously GnuCOBOL always stored COMP-5 fields using native endianness, as opposed to BINARY or COMP fields which are held in either big-endian or native format depending on the binary-byteorder configuration option. However, COBOL programs ported from the mainframe expect COMP-5 fields to be stored in big-endian format like BINARY fields, the difference between COMP-5 and BINARY being that COMP-5 fields are always treated as no-trunc regardless of the setting of the binary-truncate option. The new configuration option allows the user to request that COMP-5 fields should be stored using the same endianness as BINARY fields.
Changes
comp-5-uses-binary-byteorderto config.defcomp-5-uses-binary-byteorder: no-- the comp-5-uses-binary-byteorder option is activated
-- binary-byteorder=big-endian is specified
-- the host architecture is little-endian
Impact
comp-5-uses-binary-byteorder: nowill continue to operate unchanged.Testing
Related Issues / Discussion
comp-5-uses-binary-byteorder: yesif that can be done without impacting existing programs.Please review and provide feedback or suggestions.