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

regcomp.c: New build-time warning when compiling with clang #17182

Closed
p5pRT opened this issue Oct 13, 2019 · 6 comments
Closed

regcomp.c: New build-time warning when compiling with clang #17182

p5pRT opened this issue Oct 13, 2019 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 13, 2019

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

Searchable as RT134495$

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2019

From @jkeenan

When compiling perl 5 blead with clang, I noticed two instances of a
build-time warning not previously noted​:

warning​: result of comparison of constant 223 with expression of type
'char' is always false [-Wtautological-constant-out-of-range-compare].

See attachment.

The code in regcomp.c in question was recently added in commit
3ae8ec4 (2019-09-22).

Karl, can you take a look?

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2019

From @jkeenan

[p5p] 531 $ report-build-warnings make.blead.gcc.Wundef.output.txt
File​: make.blead.gcc.Wundef.output.txt

  Wimplicit-fallthrough= 35
  Wundef 155
  Wunused-variable 2

[p5p] 532 $ report-build-warnings make.134494-Wundef.gcc.Wundef.output.txt
File​: make.134494-Wundef.gcc.Wundef.output.txt

  Wimplicit-fallthrough= 35
  Wundef 42
  Wunused-variable 2

[perlmonger​: p5p] $ ~/bin/perl/report-build-warnings make.blead.g++.Wundef.output.txt
File​: make.blead.g++.Wundef.output.txt

  Wformat-overflow= 2
  Wimplicit-fallthrough= 32
  Wpragmas 2
  Wundef 156
  Wunused-variable 2

[perlmonger​: p5p] $ ~/bin/perl/report-build-warnings make.134494-Wundef.g++.Wundef.output.txt
File​: make.134494-Wundef.g++.Wundef.output.txt

  Wformat-overflow= 2
  Wimplicit-fallthrough= 32
  Wpragmas 2
  Wundef 42
  Wunused-variable 2

[p5p] 533 $ report-build-warnings make.blead.clang.Wundef.output.txt
File​: make.blead.clang.Wundef.output.txt

  Wtautological-constant-out-of-range-compare 2
  Wundef 155
  Wunused-variable 2

[p5p] 534 $ report-build-warnings make.134494-Wundef.clang.Wundef.output.txt
File​: make.134494-Wundef.clang.Wundef.output.txt

  Wtautological-constant-out-of-range-compare 2
  Wundef 42
  Wunused-variable 2

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2019

From @jkeenan

Summary of my perl5 (revision 5 version 31 subversion 5) configuration​:
  Commit id​: d1747a5
  Platform​:
  osname=linux
  osvers=4.15.0-65-generic
  archname=x86_64-linux
  uname='linux zareason 4.15.0-65-generic #74-ubuntu smp tue sep 17 17​:06​:04 utc 2019 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dusedevel -Dcc=clang'
  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'
  ccflags ='-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'
  cppflags='-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='4.2.1 Compatible Clang 6.0.0 (tags/RELEASE_600/final)'
  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'
  ldflags =' -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib/llvm-6.0/lib/clang/6.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 /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
  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 Oct 12 2019 22​:51​:39
  %ENV​:
  PERL2DIR="/home/jkeenan/gitwork/perl2"
  PERLBREW_HOME="/home/jkeenan/.perlbrew"
  PERLBREW_MANPATH="/home/jkeenan/perl5/perlbrew/perls/perl-5.30.0/man"
  PERLBREW_PATH="/home/jkeenan/perl5/perlbrew/bin​:/home/jkeenan/perl5/perlbrew/perls/perl-5.30.0/bin"
  PERLBREW_PERL="perl-5.30.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.31.5/x86_64-linux
  /usr/local/lib/perl5/site_perl/5.31.5
  /usr/local/lib/perl5/5.31.5/x86_64-linux
  /usr/local/lib/perl5/5.31.5

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2019

From @khwilliamson

On 10/12/19 8​:12 PM, James E Keenan (via RT) wrote​:

# New Ticket Created by James E Keenan
# Please include the string​: [perl #134495]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=134495 >

When compiling perl 5 blead with clang, I noticed two instances of a
build-time warning not previously noted​:

warning​: result of comparison of constant 223 with expression of type
'char' is always false [-Wtautological-constant-out-of-range-compare].

See attachment.

The code in regcomp.c in question was recently added in commit
3ae8ec4 (2019-09-22).

Karl, can you take a look?

Thank you very much.
Jim Keenan

This actually doesn't cause a bug due to the the current contents of
Unicode. But there is a bug in the vicinity that I am working on, and
will fix this at the same time.

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2019

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

@khwilliamson
Copy link
Contributor

This is fixed by 4e4df05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants