On Thursday-201404-10, 7:11, Yaroslav Kuzmin wrote:
1 In source code perl is found cod :
if (variable == 0x41 ) // variable == 'A'
or
if (variable == 0x20 ) // variable == ' '
or
if (variable == 0x7F) // variable == DEL
In code has a numeric value
2 Create some files *.h using perl scripts
These scripts do not work on z/OS , I edit the file charclass_invlist.h
manually.
... but in general, editing the source code manually is only a
workaround. Either the code (or in some cases, the scripts generating
the code) needs to be corrected so that it works correctly either in
ASCII-based or EBCDIC-based. Usually this means things like
#if 'A' == 0x41
...
#else
#if 'A' == 0xC1
...
#else
#error what the heck are you?
#endif
#endif
But of course for better maintainability one should use the predefined
things like #ifdef EBCDIC. (One may have to do more specific tests for
the subvariants of EBCDIC, where some of the characters dance around.)
As a general principle, the *.c should not do testing like this, and
instead the *.h files should define things (like macros) so that the
code just can be character-set-independent straight code.