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

PERL_BOOL_AS_CHAR doesn't work on g++ 7.3 #16559

Closed
p5pRT opened this issue May 16, 2018 · 8 comments
Closed

PERL_BOOL_AS_CHAR doesn't work on g++ 7.3 #16559

p5pRT opened this issue May 16, 2018 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented May 16, 2018

Migrated from rt.perl.org#133203 (status was 'open')

Searchable as RT133203$

@p5pRT
Copy link
Author

p5pRT commented May 16, 2018

From @khwilliamson

This is a bug report for perl from khw@​khw-xps-8930.(none),
generated with the help of perlbug 1.41 running under perl 5.28.0.


inline.h​:20​:5​: note​: in expansion of macro ‘PERL_ARGS_ASSERT_AV_TOP_INDEX’
  PERL_ARGS_ASSERT_AV_TOP_INDEX;
  ^
  inline.h​: In function ‘STRLEN S_sv_or_pv_pos_u2b(PerlInterpreter*,
SV*, const c har*, STRLEN, STRLEN*)’​:
  *proto.h​:4565​:2​: error​: invalid static_cast from type ‘SV* {aka sv*}’
to type ‘c*har’
  assert(sv); assert(pv)

If I redefine assert() to get past this, it fails later with things like

sv.h​:334​:24​: error​: expression cannot be used as a function
#define SvFLAGS(sv) (sv)->sv_flags

Since it continues to compile with gcc 7.3, this is not a 5.28 blocker.



Flags​:
  category=core
  severity=medium


Site configuration information for perl 5.28.0​:

Configured by khw at Tue May 15 16​:11​:21 MDT 2018.

Summary of my perl5 (revision 5 version 28 subversion 0) configuration​:
  Commit id​: 64a9c78
  Platform​:
  osname=linux
  osvers=4.15.0-20-generic
  archname=x86_64-linux-thread-multi-ld
  uname='linux khw-xps-8930 4.15.0-20-generic #21-ubuntu smp tue apr
24 06​:16​:15 utc 2018 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dprefix=/home/khw/fastbleadperl -Dusedevel
-Accflags='-Wno-deprecated' -Dman1dir=none -Dman3dir=none -Dcc=gcc
-Dusemorebits -Dusecbacktrace -Dusethreads'
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=define
  usemultiplicity=define
  use64bitint=define
  use64bitall=define
  uselongdouble=define
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='gcc'
  ccflags ='-D_REENTRANT -D_GNU_SOURCE -Wno-deprecated -fwrapv
-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include
-DUSE_C_BACKTRACE -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  optimize='-O2'
  cppflags='-D_REENTRANT -D_GNU_SOURCE -Wno-deprecated -fwrapv
-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='7.3.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='long double'
  nvsize=16
  Off_t='off_t'
  lseeksize=8
  alignbytes=16
  prototype=define
  Linker and Libraries​:
  ld='gcc'
  ldflags =' -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/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
  libs=-lpthread -lnsl -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'


@​INC for perl 5.28.0​:
  lib

/home/khw/fastbleadperl/lib/site_perl/5.28.0/x86_64-linux-thread-multi-ld
  /home/khw/fastbleadperl/lib/site_perl/5.28.0
  /home/khw/fastbleadperl/lib/5.28.0/x86_64-linux-thread-multi-ld
  /home/khw/fastbleadperl/lib/5.28.0
  /home/khw/fastbleadperl/lib/site_perl


Environment for perl 5.28.0​:
  HOME=/home/khw
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)

PATH=/home/khw/bin​:/home/khw/perl5/perlbrew/bin​:/home/khw/print/bin​:/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/usr/games​:/usr/local/games​:/snap/bin​:/home/khw/iands/www​:/home/khw/cxoffice/bin
  PERL5OPT=-w
  PERL_BADLANG (unset)
  PERL_DIFF_TOOL=wgdiff
  PERL_POD_PEDANTIC=1
  SHELL=/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented May 16, 2018

From @iabyn

On Tue, May 15, 2018 at 05​:12​:20PM -0700, karl williamson (via RT) wrote​:

inline.h​:20​:5​: note​: in expansion of macro ‘PERL_ARGS_ASSERT_AV_TOP_INDEX’
PERL_ARGS_ASSERT_AV_TOP_INDEX;
^
inline.h​: In function ‘STRLEN S_sv_or_pv_pos_u2b(PerlInterpreter*,
SV*, const c har*, STRLEN, STRLEN*)’​:
*proto.h​:4565​:2​: error​: invalid static_cast from type ‘SV* {aka sv*}’
to type ‘c*har’
assert(sv); assert(pv)

If I redefine assert() to get past this, it fails later with things like

sv.h​:334​:24​: error​: expression cannot be used as a function
#define SvFLAGS(sv) (sv)->sv_flags

Since it continues to compile with gcc 7.3, this is not a 5.28 blocker.

It builds ok for me with​:

  $ g++ --version
  g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

--
A major Starfleet emergency breaks out near the Enterprise, but
fortunately some other ships in the area are able to deal with it to
everyone's satisfaction.
  -- Things That Never Happen in "Star Trek" #13

@p5pRT
Copy link
Author

p5pRT commented May 16, 2018

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

@p5pRT
Copy link
Author

p5pRT commented May 16, 2018

From @Tux

On Wed, 16 May 2018 13​:43​:01 +0100, Dave Mitchell <davem@​iabyn.com>
wrote​:

On Tue, May 15, 2018 at 05​:12​:20PM -0700, karl williamson (via RT) wrote​:

inline.h​:20​:5​: note​: in expansion of macro ‘PERL_ARGS_ASSERT_AV_TOP_INDEX’
PERL_ARGS_ASSERT_AV_TOP_INDEX;
^
inline.h​: In function ‘STRLEN S_sv_or_pv_pos_u2b(PerlInterpreter*,
SV*, const c har*, STRLEN, STRLEN*)’​:
*proto.h​:4565​:2​: error​: invalid static_cast from type ‘SV* {aka sv*}’
to type ‘c*har’
assert(sv); assert(pv)

If I redefine assert() to get past this, it fails later with things like

sv.h​:334​:24​: error​: expression cannot be used as a function
#define SvFLAGS(sv) (sv)->sv_flags

Since it continues to compile with gcc 7.3, this is not a 5.28 blocker.

It builds ok for me with​:

$ g\+\+ \-\-version
g\+\+ \(GCC\) 7\.3\.1 20180303 \(Red Hat 7\.3\.1\-5\)

http​://perl5.test-smoke.org/report/65972
g++ version 8.0.1 20180425 (prerelease) [gcc-8-branch revision 259638]
PASS

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.27 porting perl5 on HP-UX, AIX, and openSUSE
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented May 16, 2018

From @jkeenan

On Wed, 16 May 2018 00​:12​:20 GMT, public@​khwilliamson.com wrote​:

This is a bug report for perl from khw@​khw-xps-8930.(none),
generated with the help of perlbug 1.41 running under perl 5.28.0.

-----------------------------------------------------------------
inline.h​:20​:5​: note​: in expansion of macro
‘PERL_ARGS_ASSERT_AV_TOP_INDEX’
PERL_ARGS_ASSERT_AV_TOP_INDEX;
^
inline.h​: In function ‘STRLEN
S_sv_or_pv_pos_u2b(PerlInterpreter*,
SV*, const c har*, STRLEN, STRLEN*)’​:
*proto.h​:4565​:2​: error​: invalid static_cast from type ‘SV*
{aka sv*}’
to type ‘c*har’
assert(sv); assert(pv)

If I redefine assert() to get past this, it fails later with things
like

sv.h​:334​:24​: error​: expression cannot be used as a function
#define SvFLAGS(sv) (sv)->sv_flags

Since it continues to compile with gcc 7.3, this is not a 5.28
blocker.

I can build blead on FreeBSD-11.1 using g++ 7.3.0. 'make test_harness' PASSes. I get some warnings during 'make test_prep', but most of those are from cpan-upstream modules. The warnings I get from blead-upstream code appear to be limited to the following​:

#####
$ zgrep 'warning​:' gpp.7.3.build.log.txt.gz | head -4
op.c​:5469​:34​: warning​: argument 'o' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
sv.c​:11813​:1​: warning​: '%.*g' directive writing between 1 and 133 bytes into a region of size 127 [-Wformat-overflow=]
perl.h​:6728​:34​: warning​: option '-Wc++-compat' is valid for C/ObjC but not for C++ [-Wpragmas]
op.c​:5469​:34​: warning​: argument 'o' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
#####

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

@p5pRT
Copy link
Author

p5pRT commented May 16, 2018

From @jkeenan

Summary of my perl5 (revision 5 version 28 subversion 0) configuration​:
  Commit id​: 64a9c78
  Platform​:
  osname=freebsd
  osvers=11.1-release-p9
  archname=amd64-freebsd-thread-multi
  uname='freebsd kid51-freebsd-11-install-3 11.1-release-p9 freebsd 11.1-release-p9 #0​: tue apr 3 16​:59​:16 utc 2018 root@​amd64-builder.daemonology.net​:usrobjusrsrcsysgeneric amd64 '
  config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe -fstack-protector -fno-strict-aliasing -Dcc=g++7'
  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++7'
  ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2'
  optimize='-O2 -pipe -fstack-protector -fno-strict-aliasing'
  cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='7.3.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++7'
  ldflags ='-pthread -Wl,-E -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/lib /usr/local/lib /usr/local/lib/gcc7/include/c++/ /usr/local/lib/gcc7/include/c++//x86_64-portbld-freebsd11.1 /usr/local/lib/gcc7/include/c++//backward /usr/local/lib /usr/lib
  libs=-lpthread -lgdbm -lm -lcrypt -lutil
  perllibs=-lpthread -lm -lcrypt -lutil
  libc=
  so=so
  useshrplib=false
  libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=so
  d_dlsymun=undef
  ccdlflags=' '
  cccdlflags='-DPIC -fPIC'
  lddlflags='-shared -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 freebsd
  Compiled at May 16 2018 09​:25​:31
  %ENV​:
  PERL2DIR="/home/jkeenan/gitwork/perl2"
  PERL_WORKDIR="/home/jkeenan/gitwork/perl"
  @​INC​:
  lib
  /usr/local/lib/perl5/site_perl/5.28.0/amd64-freebsd-thread-multi
  /usr/local/lib/perl5/site_perl/5.28.0
  /usr/local/lib/perl5/5.28.0/amd64-freebsd-thread-multi
  /usr/local/lib/perl5/5.28.0

@p5pRT
Copy link
Author

p5pRT commented May 21, 2018

From @khwilliamson

Further investigation indicates the real issue is not what I thought, given that others successfully compile with this compiler. As a result, I have changed the title of this ticket to

PERL_BOOL_AS_CHAR doesn't work on g++ 7.3

That is, if you pass -DPERL_BOOL_AS_CHAR to Configure, and then try to compile with g++ 7.3, you get the messages described in this ticket. Regular gcc 7.3 works.
--
Karl Williamson

@khwilliamson
Copy link
Contributor

Closing this ticket as we now use c99 making the Configure option obsolete

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

No branches or pull requests

3 participants