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] consting in Collate.xs #11460

Closed
p5pRT opened this issue Jun 24, 2011 · 6 comments
Closed

[PATCH] consting in Collate.xs #11460

p5pRT opened this issue Jun 24, 2011 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 24, 2011

Migrated from rt.perl.org#93470 (status was 'resolved')

Searchable as RT93470$

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2011

From rmbarker.cpan@btinternet.com

Created by rmbarker.cpan@btinternet.com

Collate.xs in Unicode-Collate gives compiler warnings with
-Wwrite-strings
Attached patch silences the warnings

Perl Info

Flags:
    category=library
    severity=low
    module=Unicode::Collate

Site configuration information for perl 5.14.1:

Configured by robin at Fri Jun 17 09:14:29 BST 2011.

Summary of my perl5 (revision 5 version 14 subversion 1) configuration:
  Commit id: 0278edfff05ca950bb31e6c246e6dd51b5f64392
  Platform:
    osname=linux, osvers=2.6.35-28-generic, archname=i686-linux-64int
    uname='linux spade-ubuntu 2.6.35-28-generic #50-ubuntu smp fri mar
18 19:00:26 utc 2011 i686 gnulinux '
    config_args='-des -Dcc=gcc -Doptimize=-O2
-Wno-unused-but-set-variable -DDEBUGGING -Duse64bitint -Dman3dir=none
-Dcf_email=rmbarker.cpan@btinternet.com'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
    optimize='-O2 -Wno-unused-but-set-variable -g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
    ccversion='', gccversion='4.6.0', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.12.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.12.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2
-Wno-unused-but-set-variable -g -L/usr/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.14.1:
    /usr/local/lib/perl5/site_perl/5.14.1/i686-linux-64int
    /usr/local/lib/perl5/site_perl/5.14.1
    /usr/local/lib/perl5/5.14.1/i686-linux-64int
    /usr/local/lib/perl5/5.14.1
    /usr/local/lib/perl5/site_perl/5.14.0/i686-linux-64int
    /usr/local/lib/perl5/site_perl/5.14.0
    /usr/local/lib/perl5/site_perl/5.12.3
    /usr/local/lib/perl5/site_perl/5.12.1
    /usr/local/lib/perl5/site_perl/5.12.0
    /usr/local/lib/perl5/site_perl
    .


Environment for perl 5.14.1:
    HOME=/home/robin
    LANG=en_GB.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
    LOGDIR (unset)

PATH=/home/robin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2011

From rmbarker.cpan@btinternet.com

0001-consting-in-cpan-Unicode-Collate-Collate.xs.patch
From f0b7cdc5647228baf01af439be2f0102cd79e436 Mon Sep 17 00:00:00 2001
From: Robin Barker <rmbarker@cpan.org>
Date: Wed, 22 Jun 2011 21:06:46 +0100
Subject: [PATCH] consting in cpan/Unicode-Collate/Collate.xs

Add C<const> to declaration of C<char *> in Collate.xs
that are used for fixed strings. 
Silences compiler warnings [-Wwrite-strings]
---
 cpan/Unicode-Collate/Collate.xs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpan/Unicode-Collate/Collate.xs b/cpan/Unicode-Collate/Collate.xs
index 7f00642..d9c14a6 100644
--- a/cpan/Unicode-Collate/Collate.xs
+++ b/cpan/Unicode-Collate/Collate.xs
@@ -249,7 +249,7 @@ getHST (code, uca_vers = 0)
     UV code;
     IV uca_vers;
   PREINIT:
-    char * hangtype;
+    const char * hangtype;
     STRLEN typelen;
   CODE:
     if (codeRange(Hangul_SIni, Hangul_SFin)) {
@@ -632,7 +632,7 @@ visualizeSortKey (self, key)
     STRLEN klen, dlen;
     UV uv;
     IV uca_vers;
-    static char *upperhex = "0123456789ABCDEF";
+    static const char *upperhex = "0123456789ABCDEF";
   CODE:
     if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)
 	selfHV = (HV*)SvRV(self);
-- 
1.7.1

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2011

From @cpansprout

Let’s see what happens if I forward this to the CPAN queue from within
RT....

On Fri Jun 24 05​:13​:56 2011, rmbarker.cpan@​btinternet.com wrote​:

This is a bug report for perl from rmbarker.cpan@​btinternet.com,
generated with the help of perlbug 1.39 running under perl 5.14.1.

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

Collate.xs in Unicode-Collate gives compiler warnings with
-Wwrite-strings
Attached patch silences the warnings

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=library
severity=low
module=Unicode​::Collate
---
Site configuration information for perl 5.14.1​:

Configured by robin at Fri Jun 17 09​:14​:29 BST 2011.

Summary of my perl5 (revision 5 version 14 subversion 1)
configuration​:
Commit id​: 0278edfff05ca950bb31e6c246e6dd51b5f64392
Platform​:
osname=linux, osvers=2.6.35-28-generic, archname=i686-linux-64int
uname='linux spade-ubuntu 2.6.35-28-generic #50-ubuntu smp fri mar
18 19​:00​:26 utc 2011 i686 gnulinux '
config_args='-des -Dcc=gcc -Doptimize=-O2
-Wno-unused-but-set-variable -DDEBUGGING -Duse64bitint -Dman3dir=none
-Dcf_email=rmbarker.cpan@​btinternet.com'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define,
usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2 -Wno-unused-but-set-variable -g',
cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
ccversion='', gccversion='4.6.0', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries​:
ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/lib64
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.12.1.so, so=so, useshrplib=false,
libperl=libperl.a
gnulibc_version='2.12.1'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2
-Wno-unused-but-set-variable -g -L/usr/local/lib -fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.14.1​:
/usr/local/lib/perl5/site_perl/5.14.1/i686-linux-64int
/usr/local/lib/perl5/site_perl/5.14.1
/usr/local/lib/perl5/5.14.1/i686-linux-64int
/usr/local/lib/perl5/5.14.1
/usr/local/lib/perl5/site_perl/5.14.0/i686-linux-64int
/usr/local/lib/perl5/site_perl/5.14.0
/usr/local/lib/perl5/site_perl/5.12.3
/usr/local/lib/perl5/site_perl/5.12.1
/usr/local/lib/perl5/site_perl/5.12.0
/usr/local/lib/perl5/site_perl
.

---
Environment for perl 5.14.1​:
HOME=/home/robin
LANG=en_GB.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH=/usr/lib​:/usr/local/lib
LOGDIR (unset)

PATH=/home/robin/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games

PERL\_BADLANG \(unset\)
SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Jun 24, 2011

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

@p5pRT
Copy link
Author

p5pRT commented Jul 3, 2011

From bug-Unicode-Collate@rt.cpan.org

<URL​: https://rt.cpan.org/Ticket/Display.html?id=69133 >

On 2011-6月-28 火 13​:52​:42, perlbug-followup@​perl.org wrote​:

Let’s see what happens if I forward this to the CPAN queue from within
RT....

On Fri Jun 24 05​:13​:56 2011, rmbarker.cpan@​btinternet.com wrote​:

This is a bug report for perl from rmbarker.cpan@​btinternet.com,
generated with the help of perlbug 1.39 running under perl 5.14.1.

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

Collate.xs in Unicode-Collate gives compiler warnings with
-Wwrite-strings
Attached patch silences the warnings

Thanks, applied. Unicode​::Collate 0.77 will come soon.

@p5pRT
Copy link
Author

p5pRT commented Jul 4, 2011

@cpansprout - Status changed from 'open' to 'resolved'

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