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

Encode produces copious warnings during build under gcc #19588

Closed
demerphq opened this issue Apr 6, 2022 · 4 comments
Closed

Encode produces copious warnings during build under gcc #19588

demerphq opened this issue Apr 6, 2022 · 4 comments
Labels
build-time-warnings Replaces [META] Build-time warnings RT #133556

Comments

@demerphq
Copy link
Collaborator

demerphq commented Apr 6, 2022

Module:
Encode aka cpan/Encode

Description
During build Encode in core produces copious warnings due to -Wc++-compat

byte_t.c:10394:24: warning: duplicate declaration of ‘utf8_viscii’ is invalid in C++ [-Wc++-compat]
10394 | static const encpage_t utf8_viscii[12] = {
      |                        ^~~~~~~~~~~
byte_t.c:322:24: note: previous declaration of ‘utf8_viscii’ was here
  322 | static const encpage_t utf8_viscii[];
      |                        ^~~~~~~~~~~

These warnings are bogus as the code generator produces code which is tailored for C++ or C, and the C code that is being warned about simply isn't used in a C++ build.

gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note this is a placeholder issue to record this for Perl, an issues exists for the upstream repo for this module:
dankogai/p5-encode#144

Steps to Reproduce
make

Expected behavior
No warnings.

Perl configuration

 ./perl -Ilib -V
Summary of my perl5 (revision 5 version 35 subversion 11) configuration:
  Derived from: 8cdf7451cf04f2fe6ab382f1dad065efb19b53a1
  Ancestor: 2caf82775aff58fd4599ee9fb0841a887715c56b
  Platform:
    osname=linux
    osvers=5.14.0-1032-oem
    archname=x86_64-linux-thread-multi
    uname='linux oncidium 5.14.0-1032-oem #35-ubuntu smp thu mar 31 12:49:29 utc 2022 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des -Dusethreads -Dusedevel -DDEBUGGING'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2 -g'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='9.4.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='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/x86_64-linux-gnu /usr/lib /usr/lib64
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.31.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.31'
  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
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_TRACK_MEMPOOL
    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
    USE_THREAD_SAFE_LOCALE
  Locally applied patches:
    uncommitted-changes
    8cdf7451cf04f2fe6ab382f1dad065efb19b53a1
  Built under linux
  Compiled at Apr  5 2022 18:20:19
  %ENV:
    PERLBREW_CONFIGURE_FLAGS="-de -Dcc=ccache\ gcc -Dld=gcc"
    PERLBREW_HOME="/home/yorton/.perlbrew"
    PERLBREW_MANPATH="/home/yorton/perl5/perlbrew/perls/perl-5.34.1/man"
    PERLBREW_PATH="/home/yorton/perl5/perlbrew/bin:/home/yorton/perl5/perlbrew/perls/perl-5.34.1/bin"
    PERLBREW_PERL="perl-5.34.1"
    PERLBREW_ROOT="/home/yorton/perl5/perlbrew"
    PERLBREW_SHELLRC_VERSION="0.88"
    PERLBREW_VERSION="0.88"
  @INC:
    lib
    /usr/local/lib/perl5/site_perl/5.35.11/x86_64-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.35.11
    /usr/local/lib/perl5/5.35.11/x86_64-linux-thread-multi
    /usr/local/lib/perl5/5.35.11
@demerphq
Copy link
Collaborator Author

demerphq commented Apr 6, 2022

The fix is not merged yet, reopening until it is.

@demerphq demerphq reopened this Apr 6, 2022
@jkeenan
Copy link
Contributor

jkeenan commented Apr 6, 2022

Module: Encode aka cpan/Encode

Description During build Encode in core produces copious warnings due to -Wc++-compat

byte_t.c:10394:24: warning: duplicate declaration of ‘utf8_viscii’ is invalid in C++ [-Wc++-compat]
10394 | static const encpage_t utf8_viscii[12] = {
      |                        ^~~~~~~~~~~
byte_t.c:322:24: note: previous declaration of ‘utf8_viscii’ was here
  322 | static const encpage_t utf8_viscii[];
      |                        ^~~~~~~~~~~

Note that this was first reported in #17014 three years ago. I look forward to this correction.

@demerphq
Copy link
Collaborator Author

demerphq commented Apr 6, 2022 via email

demerphq added a commit that referenced this issue Apr 7, 2022
This silences the build warnings reported in #19588
and in #17014.

It includes some test updates, but no functionality changes.
demerphq added a commit that referenced this issue Apr 7, 2022
This silences the build warnings reported in #19588
and in #17014.

It includes some test updates, but no functionality changes.
@demerphq
Copy link
Collaborator Author

demerphq commented Apr 7, 2022

Fixed with the merge of Encode 3.17.

@demerphq demerphq closed this as completed Apr 7, 2022
scottchiefbaker pushed a commit to scottchiefbaker/perl5 that referenced this issue Nov 3, 2022
This silences the build warnings reported in Perl#19588
and in Perl#17014.

It includes some test updates, but no functionality changes.
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