> -----Original Message-----
> From: Owen Leibman
> Sent: Saturday, April 02, 2016 9:43 PM
> To: 'Bram Moolenaar'
> Cc: [email protected]
> Subject: RE: Compile Error for Z/OS in regexp_nfa.c
> 
> >
> > Owen Leibman wrote:
> >
> > > > > Porting the current source code (latest stable version vim-
> > 7.4.tar.bz2
> > > > > from vim.org download page) to z/OS, I encountered the following
> > > > > problem:
> > > > > ERROR CCN3052 ./regexp_nfa.c:745   Duplicate case label for
> value
> > 193.
> > > > Labels must be unique.
> > > >
> > > > That version is already quite old.  The switch statement has
> > changed.
> > > > If you can't use git to get the latest version, you can use a
> > snapshot:
> > > > https://github.com/vim/vim/releases
> > >
> > > I have modified a version freshly downloaded from github; patch
> > attached.
> >
> > Thanks, that looks good.
> >
> > > > > There were many other messages for similar errors.
> > > > >
> > > > > The cause is similar to an error reported and fixed in 2010
> > > > (http://comments.gmane.org/gmane.editors.vim.devel/28288),
> > > > > although that problem was in regexp.c, not regexp_nfa.c (which
> is
> > > > > included from regexp.c).
> > > > >
> > > > > I am attaching a patch which allows the compile to proceed in
> > z/OS.
> > > > > The resulting executable appears to function correctly.
> > > > > I have also tested the patch on an ASCII system, where it builds
> > > > > correctly, and "make test" reports no errors.
> > > >
> > > > The method seems OK, although the list of defines is a bit hard to
> > read.
> > > > Why not use some underscores, and ALT instead of ALTERNATE:
> > > >
> > > >         #define A_ALT_1 0x62
> > > >
> > > > And change the octal numbers to hex, the multi-byte numbers are
> also
> > in
> > > > hex.
> > >
> > > I have given the defines meaningful names, and changed octal to hex.
> > >
> > > > I'm not sure this code is covered by a test.  Would be good to
> make
> > one,
> > > > so that we can check it still passes after the change (assuming
> any
> > > > test passes on this system...).
> > > >
> > > > Hmm, test99 is supposed to cover this, but when I try a change in
> > the
> > > > code it doesn't break.  Ah, it only tests [[=A=]], not the other
> > > > equivalence characters.  So only an error in the EMIT entries is
> > found,
> > > > not a mistake in the case list.
> > > >
> > > > If you want to take the time to look into this, please create a
> new
> > > > style test, it should be much simpler to write and maintain.
> > > >
> > > >
> > > Test99 failed, as it should, in both EBCDIC and ASCII environments,
> > > when I introduced a typo into the new code.
> >
> > It only tests with the base character, e.g. "[[-A=]]", not with the
> > other equivalent characters.  Thus it tests that the right characters
> > are matched, but not that they match for each character.  When making
> a
> > typo in the "case" list that won't be noticed.
> >
> > You now use the defined name in both the case and the code block that
> > follows, so that's already better.  But it's still possible to omit a
> > case.
> >
> > > It passes correctly in both environments when the typo is corrected.
> > > I understand why you want a newer test; it is easy to make a trivial
> > > addition to the tests, but it will take a while to come up with
> > > something comprehensive. I will continue to look into that.
> >
> > Please do.  Otherwise I can write one.
> 
> The attached zip file contains 4 new-style test files:
> 1. test_equivclass_mb_re1.vim - tests multi-byte characters in
> equivalence classes using regexp engine 1 (re=1)
> 2. test_equivclass_mb_re2.vim - same but with re=2
> 3. test_equivclass_sb_re1.vim - tests single-byte characters (ISO-8859-1
> or IBM-1047) re=1
> 4. test_equivclass_sb_re2.vim - same but with re=2
> All 4 tests passed on an ASCII system. Only the last 2 can be run in
> z/OS.
> Test #3 on z/OS indicated a problem, which turned out to be that O with
> slash
> (upper- and lower-case) was not included in the EBCDIC portion of
> regexp.c.
> A patch to fix that (regexp.patch) is also included in the zip file.
> 
> I was not sure how to suppress the multi-byte tests on a single-byte
> system.
> Old-style tests have an easy way of doing so;
> if there is such a method for new-style tests, it would be useful to
> include with the mb files above.

I figured out how to do this. Revised scripts for #1 and #2 attached.

> 
> I also was not sure if I was supposed to send a patch for the makefiles
> to run these tests automatically. I have not done so.
> 
> >
> > > When all the new code was ported to z/OS, there were compile errors
> in
> > > eval.c and window.c (missing definition for mb_char2bytes in the
> > > former and mb_ptr2char in the latter).
> > > I was able to come up with a simple workaround in each case, but,
> > > since it looks to me like they ought to be defined via
> > > vim.h/globals.h, I am unsure why the error showed up, and so am not
> > > satisfied that I have the "correct" solution.  I will continue to
> > > research.
> >
> > OK.  Please send a patch when you have some parts work.
> > Ah, I see you sent them already.


This email and any files transmitted with it are confidential, proprietary and 
intended solely for the individual or entity to whom they are addressed. If you 
have received this email in error please delete it immediately.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: test_equivclass_mb_re1.vim
Description: test_equivclass_mb_re1.vim

Attachment: test_equivclass_mb_re2.vim
Description: test_equivclass_mb_re2.vim

Raspunde prin e-mail lui