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

Build-time warnings: 'Wparentheses' generated by g++-8 #16708

Closed
p5pRT opened this issue Oct 3, 2018 · 14 comments
Closed

Build-time warnings: 'Wparentheses' generated by g++-8 #16708

p5pRT opened this issue Oct 3, 2018 · 14 comments
Labels
build-time-warnings Replaces [META] Build-time warnings RT #133556

Comments

@p5pRT
Copy link

p5pRT commented Oct 3, 2018

Migrated from rt.perl.org#133557 (status was 'resolved')

Searchable as RT133557$

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

From @jkeenan

If we use g++-8 to build blead, we get a variety of warnings including 3
in the 'Wparentheses' category.

#####
$ zgrep 'warning​:' linux.make.v5.29.3-25-g65104f4cf7.output.txt.gz |
perl -n -E 'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
  6 -Wcast-function-type
  2 -Wclobbered
  2 -Wformat-overflow=
  4 -Wignored-qualifiers
  33 -Wimplicit-fallthrough=
  1 -Wmultistatement-macros
  3 -Wparentheses
  3 -Wpragmas
#####

This can be seen, for example, in this smoke-test report​:
http​://perl.develop-help.com/raw/?id=215137

These 3 warnings can be silence easily. I created the
smoke-me/jkeenan/Wparentheses branch last week for this purpose. The
warnings are gone.

#####
$ zgrep 'warning​:' make.Wparentheses.output.txt.gz | perl -n -E
'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
  7 -Wcast-function-type
  2 -Wclobbered
  2 -Wformat-overflow=
  4 -Wignored-qualifiers
  33 -Wimplicit-fallthrough=
  1 -Wmultistatement-macros
  3 -Wpragmas
#####

This can also be seen in this smoke-test report (which I believe was run
on the same machine as the preceding one)​:
http​://perl.develop-help.com/raw/?id=215124

Please review the patch attached​:
0001-Eliminated-3-Wparentheses-warnings-detected-by-g-8.patch

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

From @jkeenan

0001-Eliminated-3-Wparentheses-warnings-detected-by-g-8.patch
From e47ef4b92143ac276e7b5f44e751e98b4927b2a3 Mon Sep 17 00:00:00 2001
From: James E Keenan <[email protected]>
Date: Wed, 26 Sep 2018 12:43:04 -0400
Subject: [PATCH] Eliminated 3 '-Wparentheses' warnings detected by g++-8.

---
 mathoms.c | 4 ++--
 perlio.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mathoms.c b/mathoms.c
index 375e3e330f..8b003d3538 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -518,7 +518,7 @@ int
 Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...)
 {
     int ret = 0;
-    va_list(arglist);
+    va_list arglist;
 
     /* Easier to special case this here than in embed.pl. (Look at what it
        generates for proto.h) */
@@ -536,7 +536,7 @@ int
 Perl_printf_nocontext(const char *format, ...)
 {
     dTHX;
-    va_list(arglist);
+    va_list arglist;
     int ret = 0;
 
 #ifdef PERL_IMPLICIT_CONTEXT
diff --git a/perlio.c b/perlio.c
index 3a2f9120d3..ba934ff259 100644
--- a/perlio.c
+++ b/perlio.c
@@ -5243,7 +5243,7 @@ PerlIO_getpos(PerlIO *f, SV *pos)
 void
 Perl_noperl_die(const char* pat, ...)
 {
-    va_list(arglist);
+    va_list arglist;
     PERL_ARGS_ASSERT_NOPERL_DIE;
     va_start(arglist, pat);
     vfprintf(stderr, pat, arglist);
-- 
2.17.1

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

From @jkeenan

Summary of my perl5 (revision 5 version 29 subversion 4) configuration​:
  Commit id​: e47ef4b
  Platform​:
  osname=linux
  osvers=4.15.0-34-generic
  archname=x86_64-linux-thread-multi
  uname='linux zareason 4.15.0-34-generic #37-ubuntu smp mon aug 27 15​:21​:48 utc 2018 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dusedevel -Dusethreads -Dcc=g++-8'
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=define
  usemultiplicity=define
  use64bitint=define
  use64bitall=define
  uselongdouble=undef
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='g++-8'
  ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  optimize='-O2'
  cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='8.2.0'
  gccosandvers=''
  intsize=4
  longsize=8
  ptrsize=8
  doublesize=8
  byteorder=12345678
  doublekind=3
  d_longlong=define
  longlongsize=8
  d_longdbl=define
  longdblsize=16
  longdblkind=3
  ivtype='long'
  ivsize=8
  nvtype='double'
  nvsize=8
  Off_t='off_t'
  lseeksize=8
  alignbytes=8
  prototype=define
  Linker and Libraries​:
  ld='g++-8'
  ldflags =' -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/include/c++/8 /usr/include/x86_64-linux-gnu/c++/8 /usr/include/c++/8/backward /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64
  libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
  perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.27.so
  so=so
  useshrplib=false
  libperl=libperl.a
  gnulibc_version='2.27'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=so
  d_dlsymun=undef
  ccdlflags='-Wl,-E'
  cccdlflags='-fPIC'
  lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:
  Compile-time options​:
  HAS_TIMES
  MULTIPLICITY
  PERLIO_LAYERS
  PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_IMPLICIT_CONTEXT
  PERL_MALLOC_WRAP
  PERL_OP_PARENT
  PERL_PRESERVE_IVUV
  PERL_USE_DEVEL
  USE_64_BIT_ALL
  USE_64_BIT_INT
  USE_ITHREADS
  USE_LARGE_FILES
  USE_LOCALE
  USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC
  USE_LOCALE_TIME
  USE_PERLIO
  USE_PERL_ATOF
  USE_REENTRANT_API
  Built under linux
  Compiled at Oct 3 2018 15​:09​:49
  %ENV​:
  PERL2DIR="/home/jkeenan/gitwork/perl2"
  PERLBREW_HOME="/home/jkeenan/.perlbrew"
  PERLBREW_MANPATH="/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/man"
  PERLBREW_PATH="/home/jkeenan/perl5/perlbrew/bin​:/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/bin"
  PERLBREW_PERL="perl-5.28.0"
  PERLBREW_ROOT="/home/jkeenan/perl5/perlbrew"
  PERLBREW_SHELLRC_VERSION="0.84"
  PERLBREW_VERSION="0.84"
  PERL_WORKDIR="/home/jkeenan/gitwork/perl"
  @​INC​:
  lib
  /usr/local/lib/perl5/site_perl/5.29.4/x86_64-linux-thread-multi
  /usr/local/lib/perl5/site_perl/5.29.4
  /usr/local/lib/perl5/5.29.4/x86_64-linux-thread-multi
  /usr/local/lib/perl5/5.29.4

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

From @jkeenan

On Wed, 03 Oct 2018 19​:20​:40 GMT, jkeenan@​pobox.com wrote​:

If we use g++-8 to build blead, we get a variety of warnings including 3
in the 'Wparentheses' category.

#####
$ zgrep 'warning​:' linux.make.v5.29.3-25-g65104f4cf7.output.txt.gz |
perl -n -E 'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
6 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wparentheses
3 -Wpragmas
#####

This can be seen, for example, in this smoke-test report​:
http​://perl.develop-help.com/raw/?id=215137

These 3 warnings can be silence easily. I created the
smoke-me/jkeenan/Wparentheses branch last week for this purpose. The
warnings are gone.

#####
$ zgrep 'warning​:' make.Wparentheses.output.txt.gz | perl -n -E
'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
7 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wpragmas
#####

This can also be seen in this smoke-test report (which I believe was run
on the same machine as the preceding one)​:
http​://perl.develop-help.com/raw/?id=215124

Please review the patch attached​:
0001-Eliminated-3-Wparentheses-warnings-detected-by-g-8.patch

Thank you very much.
Jim Keenan

The patch also clears up 3 'Wparentheses' warnings generated by using g++8 as C-compiler on FreeBSD-11.1. Data available upon request.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 3, 2018

From [Unknown Contact. See original ticket]

On Wed, 03 Oct 2018 19​:20​:40 GMT, jkeenan@​pobox.com wrote​:

If we use g++-8 to build blead, we get a variety of warnings including 3
in the 'Wparentheses' category.

#####
$ zgrep 'warning​:' linux.make.v5.29.3-25-g65104f4cf7.output.txt.gz |
perl -n -E 'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
6 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wparentheses
3 -Wpragmas
#####

This can be seen, for example, in this smoke-test report​:
http​://perl.develop-help.com/raw/?id=215137

These 3 warnings can be silence easily. I created the
smoke-me/jkeenan/Wparentheses branch last week for this purpose. The
warnings are gone.

#####
$ zgrep 'warning​:' make.Wparentheses.output.txt.gz | perl -n -E
'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
7 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wpragmas
#####

This can also be seen in this smoke-test report (which I believe was run
on the same machine as the preceding one)​:
http​://perl.develop-help.com/raw/?id=215124

Please review the patch attached​:
0001-Eliminated-3-Wparentheses-warnings-detected-by-g-8.patch

Thank you very much.
Jim Keenan

The patch also clears up 3 'Wparentheses' warnings generated by using g++8 as C-compiler on FreeBSD-11.1. Data available upon request.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 9, 2018

From @jkeenan

On Wed, 03 Oct 2018 19​:20​:40 GMT, jkeenan@​pobox.com wrote​:

If we use g++-8 to build blead, we get a variety of warnings including 3
in the 'Wparentheses' category.

#####
$ zgrep 'warning​:' linux.make.v5.29.3-25-g65104f4cf7.output.txt.gz |
perl -n -E 'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
6 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wparentheses
3 -Wpragmas
#####

This can be seen, for example, in this smoke-test report​:
http​://perl.develop-help.com/raw/?id=215137

These 3 warnings can be silence easily. I created the
smoke-me/jkeenan/Wparentheses branch last week for this purpose. The
warnings are gone.

#####
$ zgrep 'warning​:' make.Wparentheses.output.txt.gz | perl -n -E
'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
7 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wpragmas
#####

This can also be seen in this smoke-test report (which I believe was run
on the same machine as the preceding one)​:
http​://perl.develop-help.com/raw/?id=215124

Please review the patch attached​:
0001-Eliminated-3-Wparentheses-warnings-detected-by-g-8.patch

I'll apply this patch tomorrow unless I hear otherwise.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 9, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 10, 2018

From @jkeenan

On Tue, 09 Oct 2018 21​:12​:12 GMT, jkeenan wrote​:

On Wed, 03 Oct 2018 19​:20​:40 GMT, jkeenan@​pobox.com wrote​:

If we use g++-8 to build blead, we get a variety of warnings including 3
in the 'Wparentheses' category.

#####
$ zgrep 'warning​:' linux.make.v5.29.3-25-g65104f4cf7.output.txt.gz |
perl -n -E 'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
6 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wparentheses
3 -Wpragmas
#####

This can be seen, for example, in this smoke-test report​:
http​://perl.develop-help.com/raw/?id=215137

These 3 warnings can be silence easily. I created the
smoke-me/jkeenan/Wparentheses branch last week for this purpose. The
warnings are gone.

#####
$ zgrep 'warning​:' make.Wparentheses.output.txt.gz | perl -n -E
'chomp;($x) = $_ =~ m{.*\[(.*)]$};say $x;' | sort | uniq -c
7 -Wcast-function-type
2 -Wclobbered
2 -Wformat-overflow=
4 -Wignored-qualifiers
33 -Wimplicit-fallthrough=
1 -Wmultistatement-macros
3 -Wpragmas
#####

This can also be seen in this smoke-test report (which I believe was run
on the same machine as the preceding one)​:
http​://perl.develop-help.com/raw/?id=215124

Please review the patch attached​:
0001-Eliminated-3-Wparentheses-warnings-detected-by-g-8.patch

I'll apply this patch tomorrow unless I hear otherwise.

Thank you very much.

Applied to blead in commit fc917ff.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 11, 2018

From @jkeenan

No evidence of problems from smoke tests. Closing.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 11, 2018

@jkeenan - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented May 22, 2019

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.30.0, this and 160 other issues have been
resolved.

Perl 5.30.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.30.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

p5pRT commented May 22, 2019

@khwilliamson - Status changed from 'pending release' to 'resolved'

@p5pRT p5pRT closed this as completed May 22, 2019
@jkeenan jkeenan added the build-time-warnings Replaces [META] Build-time warnings RT #133556 label Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-time-warnings Replaces [META] Build-time warnings RT #133556
Projects
None yet
Development

No branches or pull requests

2 participants