Strange compile error on z/OS

51 views
Skip to first unread message

Ze'ev Atlas

unread,
May 6, 2024, 10:21:24 PM5/6/24
to Philip Hazel, Pcre2-dev
Hello Phil

I am getting a strange compile error inside pcre2.h.  I am providing the relevant section from the compiler output.  Remember, I work with 8 bytes only.  The compiler is expanding PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS  and complains about perhaps missing ';' or ','.  Could you try to shed some light on this please.
Thank you


   949       |#define PCRE2_LOCAL_WIDTH 8                                                                       |  22755    14
   950       |PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS                                                              |  22756    14
   950       +struct pcre2_real_general_context_8; typedef struct pcre2_real_general_context_8 pcre2_general_co\+  22756    14
 ===========> ..................................................................................................
   950       +ntext_8; struct pcre2_real_compile_context_8; typedef struct pcre2_real_compile_context_8 pcre2_c\+  22756    14
 ===========> ..................................................................................................
   950       +ompile_context_8; struct pcre2_real_match_context_8; typedef struct pcre2_real_match_context_8 pc\+  22756    14
 ===========> ..................................................................................................
   950       +re2_match_context_8; struct pcre2_real_convert_context_8; typedef struct pcre2_real_convert_conte\+  22756    14
 ===========> ..................................................................................................
   950       +xt_8 pcre2_convert_context_8; struct pcre2_real_code_8; typedef struct pcre2_real_code_8 pcre2_co\+  22756    14
 ===========> ..................................................................................................
   950       +de_8; struct pcre2_real_match_data_8; typedef struct pcre2_real_match_data_8 pcre2_match_data_8; \+  22756    14
 ===========> ..................................................................................................
   950       +struct pcre2_real_jit_stack_8; typedef struct pcre2_real_jit_stack_8 pcre2_jit_stack_8; typedef p\+  22756    14
 ===========> ..................................................................................................
   950       +cre2_jit_stack_8 *(*pcre2_jit_callback_8)(void *); typedef struct pcre2_callout_block_8 { uint32_\+  22756    14
 ===========> ..................................................................................................
   950       +t version; uint32_t callout_number; uint32_t capture_top; uint32_t capture_last; size_t *offset_v\+  22756    14
 ===========> ..................................................................................................
   950       +ector; PCRE2_SPTR8 mark; PCRE2_SPTR8 subject; size_t subject_length; size_t start_match; size_t c\+  22756    14
 ===========> ..................................................................................................
   950       +urrent_position; size_t pattern_position; size_t next_item_length; size_t callout_string_offset; \+  22756    14
 ===========> ..................................................................................................
   950       +size_t callout_string_length; PCRE2_SPTR8 callout_string; uint32_t callout_flags; } pcre2_callout\+  22756    14
 ===========> ..................................................................................................
   950       +_block_8; typedef struct pcre2_callout_enumerate_block_8 { uint32_t version; size_t pattern_posit\+  22756    14
 ===========> ..................................................................................................
   950       +ion; size_t next_item_length; uint32_t callout_number; size_t callout_string_offset; size_t callo\+  22756    14
 ===========> ..................................................................................................
   950       +ut_string_length; PCRE2_SPTR8 callout_string; } pcre2_callout_enumerate_block_8; typedef struct p\+  22756    14
 ===========> ..................................................................................................
   950       +cre2_substitute_callout_block_8 { uint32_t version; PCRE2_SPTR8 input; PCRE2_SPTR8 output; size_t\+  22756    14
 ===========> ..................................................................................................
   950       + output_offsets[2]; size_t *ovector; uint32_t oveccount; uint32_t subscount; } pcre2_substitute_c\+  22756    14
 ===========> ..................................................................................................
   950       +allout_block_8; extern PCRE2_EXPORT int   pcre2_config_8(uint32_t, void *); extern PCRE2_EXPORT p\+  22756    14
 ===========> ................................................................................................a.
 *=ERROR===========> a - CCN3277 Syntax error: possible missing ';' or ','?
   950       +cre2_general_context_8 * pcre2_general_context_copy_8(pcre2_general_context_8 *); extern PCRE2_EX\+  22756    14
   950       +PORT pcre2_general_context_8 * pcre2_general_context_create_8(void *(*)(size_t, void *), void (*)\+  22756    14
   950       +(void *, void *), void *); extern PCRE2_EXPORT void   pcre2_general_context_free_8(pcre2_general_\+  22756    14
   950       +context_8 *); extern PCRE2_EXPORT pcre2_compile_context_8 * pcre2_compile_context_copy_8(pcre2_co\+  22756    14
   950       +mpile_context_8 *); extern PCRE2_EXPORT pcre2_compile_context_8 * pcre2_compile_context_create_8(\+  22756    14


Ze'ev Atlas

Philip Hazel

unread,
May 7, 2024, 11:44:23 AM5/7/24
to Ze'ev Atlas, Pcre2-dev
Hi,
I'm afraid I have no idea. The lines you show seem to be truncated. Is this PCRE2 10.43 or the current HEAD code? A new function was recently added, but I've just looked at the code and can see nothing wrong.
Regards,
Philip

Ze'ev Atlas

unread,
May 7, 2024, 11:56:49 AM5/7/24
to Philip Hazel, Pcre2-dev
Hi
1.  No it is not truncated, thelines jus are cut in the middle and continue on next line
2. This is 10.43
3. I am acvounted for all new functions, it is failing to comile on the dftables, on something that had mot chnged.  I compared my pcre2.h to your generic, asuming that my process may have introduced an error, but they are identical

Apparemtly the issue is burried deeper.  I will compare all header files.  If I do not find, I may come with more detaled questions
Thank you

Carlo Arenas

unread,
Jun 14, 2024, 1:14:22 AM6/14/24
to PCRE2 discussion list
this should not be longer a problem with 10.44

Ze'ev Atlas

unread,
Jun 27, 2024, 10:47:45 PM6/27/24
to Carlo Arenas, pcre...@googlegroups.com
Hi Carlo
As suggested, I've abandoned the effort to port 10.43 and set my aim on 10.44 which, according to you, the issues have been fixed
I do have both of those defined in my parameters.
    HAVE_CONFIG_H
    PCRE2_EXPORT
Yet the issue did not disappear!
I get:
"ERROR CCN3275 ZATLAS1.PCRE2.SRCE(PCRE2):953   Unexpected text integer constant encountered."

If I do not provide the PCRE2_EXPORT
I get:
ERROR CCN3277 ZATLAS1.PCRE2.SRCE(PCRE2):953   Syntax error: possible missing ';' or ','? 

Which means that having it in the config.h is not enough.

(line 953 is inside the pcre2_internal.h header)

Now, we have a standard C compiler, created, maintained and used by a respected company, IBM, yet it fails miserably.  This failure started beginning from 10.43.  Before 10.43, I never encountered any issue.  Is it possible that some non-standard code (tolerated by the non-standard gcc,) have been introduced to PCRE2, and is it possible to remove that non-standard code and replace it by standard C code?

Ze'ev Atlas



On Monday, June 17, 2024 at 04:39:46 AM EDT, Carlo Arenas <car...@gmail.com> wrote:


No, this was about compilation problems that refer to
PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS, and that was really caused by a
missing definition and the use of non gcc compilers.

Both of those issues are fixed now in master, but the compilation
problem was already released with 10.44, as I mentioned originally.


Carlo

Carlo Arenas

unread,
Jun 27, 2024, 11:19:47 PM6/27/24
to Ze'ev Atlas, pcre...@googlegroups.com
On Thu, Jun 27, 2024 at 9:47 PM Ze'ev Atlas <zat...@yahoo.com> wrote:
>
> As suggested, I've abandoned the effort to port 10.43 and set my aim on 10.44 which, according to you, the issues have been fixed
> I do have both of those defined in my parameters.
> HAVE_CONFIG_H
> PCRE2_EXPORT
> Yet the issue did not disappear!
> I get:
> "ERROR CCN3275 ZATLAS1.PCRE2.SRCE(PCRE2):953 Unexpected text integer constant encountered."

this might be a problem with the way you added PCRE2_EXPORT as a
parameter, usually a "define" without any value is set to 1, but you
want to provide a value instead (an empty string should be enough)

> If I do not provide the PCRE2_EXPORT
> I get:
> ERROR CCN3277 ZATLAS1.PCRE2.SRCE(PCRE2):953 Syntax error: possible missing ';' or ','?
>
> Which means that having it in the config.h is not enough.

does changing config.h so it reads

#define PCRE2_EXPORT ""

fix the problem with your compiler?

Carlo

Ze'ev Atlas

unread,
Jun 28, 2024, 1:27:51 AM6/28/24
to Carlo Arenas, pcre...@googlegroups.com
Hi Carlo,
My process actually did internally #undef to PCRE2_EXPORT.  I corrected that and now it seems to be working fine.

Could you please provide a little more detailed explanation.  I had recruited a whole team of z>OS enthusiasts to help me, and I owe them a better explanation, so please

Ze'ev Atlas
201-801-0378
201-805-0286 (cell)


Carlo Arenas

unread,
Jun 28, 2024, 4:06:33 AM6/28/24
to Ze'ev Atlas, pcre...@googlegroups.com
On Fri, Jun 28, 2024 at 12:27 AM Ze'ev Atlas <zat...@yahoo.com> wrote:

> Could you please provide a little more detailed explanation. I had recruited a whole team of z>OS enthusiasts to help me, and I owe them a better explanation

PCRE2_EXPORT is what the functions that are meant to be public will
use as a decorator if HAVE_VISIBILITY == 1 and you are not building in
Windows.

Indeed if you are using xlc and -qvisibility=hidden is supported in
your compiler, it will be better if you set it to something similar to
what gcc/clang does.

If you are using the latest clang compiler instead then the compiler
flag is -fvisibility=hidden; for both cases setting HAVE_VISIBILITY
would be also needed.

Carlo
Reply all
Reply to author
Forward
0 new messages