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

[PATCH] Add prototypes for 6 mathoms to satisfy -Wmissing-prototypes #15816

Closed
p5pRT opened this issue Jan 20, 2017 · 9 comments
Closed

[PATCH] Add prototypes for 6 mathoms to satisfy -Wmissing-prototypes #15816

p5pRT opened this issue Jan 20, 2017 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 20, 2017

Migrated from rt.perl.org#130592 (status was 'rejected')

Searchable as RT130592$

@p5pRT
Copy link
Author

p5pRT commented Jan 20, 2017

From @petdance

Created by @petdance

clang -Wmissing-prototypes has turned up these 6 functions that
need prototypes. When we fix these, we should be able to always use
-Wmissing-prototypes.

Perl Info

Flags:
    category=core
    severity=low
    Type=Patch
    PatchStatus=HasPatch

Site configuration information for perl 5.24.0:

Configured by andy at Sun Jun  5 23:28:46 CDT 2016.

Summary of my perl5 (revision 5 version 24 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=3.10.0-327.18.2.el7.x86_64, archname=x86_64-linux
    uname='linux clifford 3.10.0-327.18.2.el7.x86_64 #1 smp thu may 12 11:03:55 utc 2016 x86_64 x86_64 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/andy/perl5/perlbrew/perls/perl-5.24.0 -Aeval:scriptdir=/home/andy/perl5/perlbrew/perls/perl-5.24.0/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fwrapv -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='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion='', gccversion='4.8.5 20150623 (Red Hat 4.8.5-4)', 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 /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.17'
  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'

Locally applied patches:
    Devel::PatchPerl 1.38


@INC for perl 5.24.0:
    /home/andy/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
    /home/andy/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0
    /home/andy/perl5/perlbrew/perls/perl-5.24.0/lib/5.24.0/x86_64-linux
    /home/andy/perl5/perlbrew/perls/perl-5.24.0/lib/5.24.0
    .


Environment for perl 5.24.0:
    HOME=/home/andy
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/andy/perl5/perlbrew/bin:/home/andy/perl5/perlbrew/perls/perl-5.24.0/bin:/home/andy/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
    PERLBREW_BASHRC_VERSION=0.75
    PERLBREW_HOME=/home/andy/.perlbrew
    PERLBREW_MANPATH=/home/andy/perl5/perlbrew/perls/perl-5.24.0/man
    PERLBREW_PATH=/home/andy/perl5/perlbrew/bin:/home/andy/perl5/perlbrew/perls/perl-5.24.0/bin
    PERLBREW_PERL=perl-5.24.0
    PERLBREW_ROOT=/home/andy/perl5/perlbrew
    PERLBREW_VERSION=0.75
    PERLCRITIC=/home/andy/tw/Dev/perlcriticrc
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jan 20, 2017

From @petdance

0001-Add-prototypes-for-6-functions-to-satisfy-Wmissing-p.patch
From 347e62f88e069e6d10f54036400428f7f10f6fdd Mon Sep 17 00:00:00 2001
From: Andy Lester <andy@petdance.com>
Date: Sun, 15 Jan 2017 12:12:29 -0600
Subject: [PATCH] Add prototypes for 6 functions to satisfy
 -Wmissing-prototypes

---
 mathoms.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mathoms.c b/mathoms.c
index 92cd77a..4916433 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -143,6 +143,7 @@ Perl_sv_2uv(pTHX_ SV *sv)
  * this function provided for binary compatibility only
  */
 
+NV Perl_sv_2nv(pTHX_ SV *sv); /* prototype to pass -Wmissing-prototypes */
 NV
 Perl_sv_2nv(pTHX_ SV *sv)
 {
@@ -154,6 +155,7 @@ Perl_sv_2nv(pTHX_ SV *sv)
  * this function provided for binary compatibility only
  */
 
+char *Perl_sv_2pv(pTHX_ SV *sv, STRLEN *lp); /* prototype to pass -Wmissing-prototypes */
 char *
 Perl_sv_2pv(pTHX_ SV *sv, STRLEN *lp)
 {
@@ -555,6 +557,7 @@ Perl_printf_nocontext(const char *format, ...)
  * So it is in perl for (say) POSIX to use.
  * Needed for SunOS with Sun's 'acc' for example.
  */
+NV Perl_huge(void); /* prototype to pass -Wmissing-prototypes */
 NV
 Perl_huge(void)
 {
@@ -1073,6 +1076,7 @@ Perl_my_lstat(pTHX)
     return my_lstat_flags(SV_GMAGIC);
 }
 
+I32 Perl_sv_eq(pTHX_ SV *sv1, SV *sv2); /* prototype to pass -Wmissing-prototypes */
 I32
 Perl_sv_eq(pTHX_ SV *sv1, SV *sv2)
 {
@@ -1080,6 +1084,7 @@ Perl_sv_eq(pTHX_ SV *sv1, SV *sv2)
 }
 
 #ifdef USE_LOCALE_COLLATE
+char * Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp); /* prototype to pass -Wmissing-prototypes */
 char *
 Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp)
 {
@@ -1099,6 +1104,7 @@ Perl_mem_collxfrm(pTHX_ const char *input_string, STRLEN len, STRLEN *xlen)
 
 #endif
 
+bool Perl_sv_2bool(pTHX_ SV *const sv); /* prototype to pass -Wmissing-prototype */
 bool
 Perl_sv_2bool(pTHX_ SV *const sv)
 {
-- 
1.8.3.1

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2017

From @iabyn

On Thu, Jan 19, 2017 at 09​:06​:43PM -0800, Andy Lester wrote​:

clang -Wmissing-prototypes has turned up these 6 functions that
need prototypes. When we fix these, we should be able to always use
-Wmissing-prototypes.
diff --git a/mathoms.c b/mathoms.c

index 92cd77a..4916433 100644
--- a/mathoms.c
+++ b/mathoms.c
@​@​ -143,6 +143,7 @​@​ Perl_sv_2uv(pTHX_ SV *sv)
* this function provided for binary compatibility only
*/

+NV Perl_sv_2nv(pTHX_ SV *sv); /* prototype to pass -Wmissing-prototypes */
NV
Perl_sv_2nv(pTHX_ SV *sv)

Shouldn't instead those prototypes be automatically generated by adding
the 'b' flag to embed.fnc?

--
Monto Blanco... scorchio!

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2017

From @petdance

Shouldn't instead those prototypes be automatically generated by adding
the 'b' flag to embed.fnc?

They're not in embed.fnc. I'm assuming that's because they're mathoms, only there for backward compatibility.

--
Andy Lester => www.petdance.com

@p5pRT
Copy link
Author

p5pRT commented Jan 23, 2017

From @iabyn

On Sat, Jan 21, 2017 at 11​:12​:26AM -0600, Andy Lester wrote​:

Shouldn't instead those prototypes be automatically generated by adding
the 'b' flag to embed.fnc?

They're not in embed.fnc. I'm assuming that's because they're mathoms,
only there for backward compatibility.

Then they need to have entries added to embed.fnc, like the other
functions in mathoms.c already have. For example, Perl_sv_2iv() is in
mathoms.c and has this entry in embed.fnc​:

  Apmb |IV |sv_2iv |NN SV *sv

--
Justice is when you get what you deserve.
Law is when you get what you pay for.

@p5pRT
Copy link
Author

p5pRT commented Jan 23, 2017

From @petdance

On Jan 23, 2017, at 3​:45 AM, Dave Mitchell <davem@​iabyn.com> wrote​:

Then they need to have entries added to embed.fnc,

Thanks. I’ll close this ticket when I’ve done that.


Andy Lester => www.petdance.com

@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2017

From @petdance

This has been closed and moved to 130717.

@p5pRT p5pRT closed this as completed Feb 4, 2017
@p5pRT
Copy link
Author

p5pRT commented Feb 4, 2017

@petdance - Status changed from 'open' to 'rejected'

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

1 participant