Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #144, spurious warnings from -Wc++-compate, and a few related nits #168

Merged
merged 3 commits into from Apr 7, 2022

Conversation

demerphq
Copy link
Contributor

@demerphq demerphq commented Apr 6, 2022

This silences the copious warnings produced by modern versions of gcc when compiling with -Wc++-compat. These warnings are bogus as the code actually has different codepaths via defines for C++ and C, so warning about C code that wont compile in C++ is not helpful.

This also fixes a few other minor nits I noticed when building and testing.

The Perl issue this fixes is: Perl/perl5#19588
The Encode issues this fixes is: #144

Currently when building Encode as part of core perl it produces a large
number of warnings like this:

byte_t.c:10394:24: warning: duplicate declaration of ‘utf8_viscii’ is invalid in C++ [-Wc++-compat]
10394 | static const encpage_t utf8_viscii[12] = {
      |                        ^~~~~~~~~~~
byte_t.c:322:24: note: previous declaration of ‘utf8_viscii’ was here
  322 | static const encpage_t utf8_viscii[];
      |                        ^~~~~~~~~~~

These -Wc++-compat warnings are bogus as the generated code uses define
guards to compile differently under C++ and C, the code producing the
warnings simply will not be compiled under C++ so simply silence the
warning. This patch only applies to builds under GCC, but that is
probably the bulk of our core perl builders.

Thanks to Leon Timmermans for the pragma used in this patch.

This should fix Perl/perl5#19588 and
dankogai#144
The first if in this sequence has a comment which says:

"VMS may have upcased filenames with DECC$ARGV_PARSE_STYLE defined"

but only the *first* clause actually uses /i to match the filename extensions.
This patch consistently uses /i for all the clauses, it also removes an
unused filename capture.
The message says "skipped in 5.26", but the code actually
skips in 5.25 or later. Make the skip messages more correct
and less confusing.
@dankogai dankogai merged commit 2dfb8f2 into dankogai:master Apr 7, 2022
@dankogai
Copy link
Owner

dankogai commented Apr 7, 2022

Thank you. Since this PR resolves compiler issues of Perl main I will $VERSION++ right after this.

Dan

@demerphq
Copy link
Contributor Author

demerphq commented Apr 7, 2022 via email

@dankogai
Copy link
Owner

dankogai commented Apr 7, 2022 via email

kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Apr 25, 2022
Changelog:
==========
! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t
  Pulled: Fix Issue openembedded#144, spurious warnings from -Wc++-compate,
   and a few related nits
  dankogai/p5-encode#168
! MANIFEST
  add t/utf32warnings.t which was missing
! t/taint.t
  Pulled: Skip taint tests if your perl was built without taint support
  dankogai/p5-encode#167
! Unicode/Unicode.pm
  Pulled: fix link to Unicode standard
  dankogai/p5-encode#165
! t/Unicode_trailing_nul.t
  Pulled: Use note() instead of diag()
  dankogai/p5-encode#164

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Apr 25, 2022
Changelog:
==========
! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t
  Pulled: Fix Issue openembedded#144, spurious warnings from -Wc++-compate,
   and a few related nits
  dankogai/p5-encode#168
! MANIFEST
  add t/utf32warnings.t which was missing
! t/taint.t
  Pulled: Skip taint tests if your perl was built without taint support
  dankogai/p5-encode#167
! Unicode/Unicode.pm
  Pulled: fix link to Unicode standard
  dankogai/p5-encode#165
! t/Unicode_trailing_nul.t
  Pulled: Use note() instead of diag()
  dankogai/p5-encode#164

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
halstead pushed a commit to openembedded/meta-openembedded that referenced this pull request May 3, 2022
Changelog:
==========
! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t
  Pulled: Fix Issue #144, spurious warnings from -Wc++-compate,
   and a few related nits
  dankogai/p5-encode#168
! MANIFEST
  add t/utf32warnings.t which was missing
! t/taint.t
  Pulled: Skip taint tests if your perl was built without taint support
  dankogai/p5-encode#167
! Unicode/Unicode.pm
  Pulled: fix link to Unicode standard
  dankogai/p5-encode#165
! t/Unicode_trailing_nul.t
  Pulled: Use note() instead of diag()
  dankogai/p5-encode#164

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit a21bab9)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
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.

None yet

2 participants