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

Re: [perl #134131] Compilation warnings with clang 9.0.0

Thread Previous | Thread Next
From:
demerphq
Date:
May 23, 2019 15:06
Subject:
Re: [perl #134131] Compilation warnings with clang 9.0.0
Message ID:
CANgJU+UZGqCxM_XmS+-+cskRfuUNOXQ8r9QarDkP-VmVb93v7A@mail.gmail.com
Am I missing something here? This seems like pretty reasonable code and
perfectly normal pointer arithmetic.

Yves

On Thu, 23 May 2019, 11:34 Sergey Aleynikov (via RT), <
perlbug-followup@perl.org> wrote:

> # New Ticket Created by  Sergey Aleynikov
> # Please include the string:  [perl #134131]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=134131 >
>
>
> 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 clang 9.0.0
>
> Wstring-plus-int:
>
> sv.c:12490:41: warning: adding 'int' to a string does not append to
> the string [-Wstring-plus-int]
>                  && strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
>                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> ./handy.h:508:37: note: expanded from macro 'strnEQ'
> #define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
>                                     ^~
> sv.c:12490:41: note: use array indexing to silence this warning
>                  && strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
>                                         ^
>                                   &     [
> ./handy.h:508:37: note: expanded from macro 'strnEQ'
> #define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
>                                     ^
> 1 warning generated.
>
> [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=clang-9'
>     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='clang-9'
>     ccflags ='-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='-DDEBUGGING -fno-strict-aliasing -pipe
> -fstack-protector-strong -I/usr/local/include'
>     ccversion=''
>     gccversion='4.2.1 Compatible Clang 9.0.0 (trunk)'
>     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='clang-9'
>     ldflags =' -fstack-protector-strong -L/usr/local/lib'
>     libpth=/usr/local/lib /usr/lib/llvm-9/lib/clang/9.0.0/lib
> /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 12:26:06
>   %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
>
>

Thread Previous | Thread Next


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