develooper Front page | perl.perl5.porters | Postings from May 2019

[perl #134129] New compilation warnings with gcc 8.3.0

From:
Sergey Aleynikov
Date:
May 23, 2019 09:13
Subject:
[perl #134129] New compilation warnings with gcc 8.3.0
Message ID:
rt-4.0.24-16854-1558602792-1873.134129-75-0@perl.org
# New Ticket Created by  Sergey Aleynikov 
# Please include the string:  [perl #134129]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=134129 >


This is a bug report for perl from sergey.aleynikov@gmail.com,
generated with the help of perlbug 1.41 running under perl 5.31.0.


-----------------------------------------------------------------
[Please describe your issue here]

I get the following warnings when building perl on Debian with gcc
8.3.0. Wimplicit-fallthrough is from at least 7.4.0, others are new
ones:

Wcast-function-type (some of them, all are about signal handlers):

perl.c: In function ‘Perl_sys_init’:
perl.h:2688:51: warning: cast between incompatible function types from
‘__sighandler_t’ {aka ‘void (*)(int)’} to ‘void (*)(int,  siginfo_t *,
void *)’ {aka ‘void (*)(int,  struct <anonymous> *, void *)’}
[-Wcast-function-type]
 #    define PERL_FPU_INIT       PL_sigfpe_saved = (Sighandler_t)
signal(SIGFPE, SIG_IGN)
                                                   ^
unixish.h:150:29: note: in expansion of macro ‘PERL_FPU_INIT’
  MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
                             ^~~~~~~~~~~~~
perl.c:125:5: note: in expansion of macro ‘PERL_SYS_INIT_BODY’
     PERL_SYS_INIT_BODY(argc, argv);
     ^~~~~~~~~~~~~~~~~~

perl.c: In function ‘S_parse_body’:
perl.c:2399:22: warning: cast between incompatible function types from
‘void (*)(int)’ to ‘void (*)(int,  siginfo_t *, void *)’ {aka ‘void
(*)(int,  struct <anonymous> *, void *)’} [-Wcast-function-type]
      if (sigstate == (Sighandler_t) SIG_IGN) {
                      ^
In file included from perl.h:5359,
                 from perl.c:37:
perl.c:2402:26: warning: cast between incompatible function types from
‘void (*)(int)’ to ‘void (*)(int,  siginfo_t *, void *)’ {aka ‘void
(*)(int,  struct <anonymous> *, void *)’} [-Wcast-function-type]
   (void)rsignal(SIGCHLD, (Sighandler_t)SIG_DFL);
                          ^
embed.h:643:44: note: in definition of macro ‘rsignal’
 #define rsignal(a,b)  Perl_rsignal(aTHX_ a,b)

util.c: In function ‘Perl_rsignal’:
util.c:2698:22: warning: cast between incompatible function types from
‘Sighandler_t’ {aka ‘void (*)(int,  struct <anonymous> *, void *)’} to
‘void (*)(int)’ [-Wcast-function-type]
     act.sa_handler = (void(*)(int))handler;
                      ^

pp_sys.c: In function ‘Perl_pp_system’:
pp_sys.c:4421:28: warning: cast between incompatible function types
from ‘void (*)(int)’ to ‘void (*)(int,  siginfo_t *, void *)’ {aka
‘void (*)(int,  struct <anonymous> *, void *)’} [-Wcast-function-type]
      rsignal_save(SIGINT,  (Sighandler_t) SIG_IGN, &ihand);
                            ^
embed.h:1560:55: note: in definition of macro ‘rsignal_save’
 #define rsignal_save(a,b,c) Perl_rsignal_save(aTHX_ a,b,c)
                                                       ^
Wimplicit-fallthrough:

decompress.c: In function ‘BZ2_decompress’:
decompress.c:198:10: warning: this statement may fall through
[-Wimplicit-fallthrough=]
       if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC);
          ^
decompress.c:44:4: note: here
    case lll: s->state = lll;                      \
    ^~~~
decompress.c:68:4: note: in expansion of macro ‘GET_BITS’
    GET_BITS(lll,uuu,8)
    ^~~~~~~~
decompress.c:200:7: note: in expansion of macro ‘GET_UCHAR’
       GET_UCHAR(BZ_X_MAGIC_2, uc);
       ^~~~~~~~~

Wmultistatement-macros:

deflate.c: In function ‘deflateParams’:
deflate.c:602:28: warning: macro expands to multiple statements
[-Wmultistatement-macros]
                 CLEAR_HASH(s);
                            ^
deflate.c:193:5: note: in definition of macro ‘CLEAR_HASH’
     s->head[s->hash_size-1] = NIL; \
     ^
deflate.c:601:13: note: some parts of macro expansion are not guarded
by this ‘else’ clause
             else
             ^~~~


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.31.0:

Configured by dur-randir at Wed Feb 27 14:51:01 MSK 2019.

Summary of my perl5 (revision 5 version 31 subversion 0) configuration:
  Commit id: 58f4626762668e1c1948832073998af84b2c85d0
  Platform:
    osname=linux
    osvers=4.19.0-5-amd64
    archname=x86_64-linux
    uname='linux dorothy 4.19.0-5-amd64 #1 smp debian 4.19.37-3
(2019-05-15) x86_64 gnulinux '
    config_args='-de -Dusedevel -DDEBUGGING -Dcc=gcc-8'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc-8'
    ccflags ='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2 -g'
    cppflags='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='8.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='gcc-8'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/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
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.28.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.28'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl):
  Compile-time options:
    DEBUGGING
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_DEVEL
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Built under linux
  Compiled at May 23 2019 11:40:52
  %ENV:
    PERLBREW_BASHRC_VERSION="0.78"
    PERLBREW_HOME="/home/afl/.perlbrew"
    PERLBREW_MANPATH="/home/afl/perlbrew/perls/perl-5.20.2/man"
    PERLBREW_PATH="/home/afl/perlbrew/bin:/home/afl/perlbrew/perls/perl-5.20.2/bin"
    PERLBREW_PERL="perl-5.20.2"
    PERLBREW_ROOT="/home/afl/perlbrew"
    PERLBREW_VERSION="0.78"
  @INC:
    lib
    /usr/local/lib/perl5/site_perl/5.31.0/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.31.0
    /usr/local/lib/perl5/5.31.0/x86_64-linux
    /usr/local/lib/perl5/5.31.0




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About