Skip to content

Conversation

@tobil4sk
Copy link
Contributor

This file is included by pcre2_tables.c, so it should not be built manually, otherwise it causes loads of errors like this:

pcre2-10.42/src/pcre2_ucptables.c:1517:3: warning: braces around scalar initializer
 1517 |   { 3563, PT_SC, ucp_Unknown }
      |   ^
pcre2-10.42/src/pcre2_ucptables.c:1517:3: note: (near initialization for ‘PRIV’)
pcre2-10.42/src/pcre2_ucptables.c:1517:5: error: invalid initializer
 1517 |   { 3563, PT_SC, ucp_Unknown }
      |     ^~~~
pcre2-10.42/src/pcre2_ucptables.c:1517:5: note: (near initialization for ‘PRIV’)
pcre2-10.42/src/pcre2_ucptables.c:1517:11: warning: excess elements in scalar initializer
 1517 |   { 3563, PT_SC, ucp_Unknown }
      |           ^~~~~
pcre2-10.42/src/pcre2_ucptables.c:1517:11: note: (near initialization for ‘PRIV’)
pcre2-10.42/src/pcre2_ucptables.c:1517:18: warning: excess elements in scalar initializer
 1517 |   { 3563, PT_SC, ucp_Unknown }
      |                  ^~~~~~~~~~~
pcre2-10.42/src/pcre2_ucptables.c:1517:18: note: (near initialization for ‘PRIV’)
pcre2-10.42/src/pcre2_ucptables.c:1517:3: warning: excess elements in scalar initializer
 1517 |   { 3563, PT_SC, ucp_Unknown }
      |   ^
pcre2-10.42/src/pcre2_ucptables.c:1517:3: note: (near initialization for ‘PRIV’)
pcre2-10.42/src/pcre2_ucptables.c:1520:7: error: unknown type name ‘size_t’
 1520 | const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
      |       ^~~~~~
pcre2-10.42/src/pcre2_ucptables.c:1520:1: warning: parameter names (without types) in function declaration
 1520 | const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
      | ^~~~~
pcre2-10.42/src/pcre2_ucptables.c:1520:1: error: function ‘PRIV’ is initialized like a variable
pcre2-10.42/src/pcre2_ucptables.c:1520:43: error: ‘utt’ undeclared here (not in a function)
 1520 | const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
      |                                           ^~~
pcre2-10.42/src/pcre2_ucptables.c:1520:58: error: ‘ucp_type_table’ undeclared here (not in a function)
 1520 | const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
      |

See:

#include "pcre2_ucptables.c"

The makefile already acknowledges this:

# The pcre2_ucptables.c file is #included by pcre2_tables.c

Perhaps it should also be removed from BUILD.bazel and build.zig. I'm not sure how these have been added since it seems like they shouldn't compile.

This file is included by pcre2_tables.c, so it should not be built
manually otherwise it causes errors.
@tobil4sk
Copy link
Contributor Author

Looks like the compiler errors only occur when -DSUPPORT_UNICODE is set in the command line. If it is not set this way, then the config.h is never loaded anyway so the #if SUPPORT_UNICODE in pcre2_ucptables.c is never triggered.

Either way, this file is already included in pcre2_tables.c so there is no point in compiling it manually.

@PhilipHazel PhilipHazel merged commit 1dd18c0 into PCRE2Project:master Mar 22, 2023
@tobil4sk tobil4sk deleted the fix/docs-pcre2_ucptables.c branch March 22, 2023 17:37
@PhilipHazel
Copy link
Collaborator

Thanks for noticing. I will remove it from BUILD.bazel and build.zig (which were contributed files).

@tobil4sk
Copy link
Contributor Author

As a side note, the bazel file also has a typo currently, which breaks it:

"src/pcre2_ckdint.c",

The source file name here should be "src/pcre2_chkdint.c"

@PhilipHazel
Copy link
Collaborator

You were just in time - I was already editing the file; I have fixed the typo as well as removing pcre2_ucptables.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants