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 5.5.660] squash malloc.c compile warnings #1219

Closed
p5pRT opened this issue Feb 23, 2000 · 3 comments
Closed

[PATCH 5.5.660] squash malloc.c compile warnings #1219

p5pRT opened this issue Feb 23, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 23, 2000

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

Searchable as RT2203$

@p5pRT
Copy link
Author

p5pRT commented Feb 23, 2000

From domo@computer.org

On compiling malloc.c, I see

malloc.c​:1391​: warning​: `morecore' was declared implicitly `extern' and later `static'
malloc.c​:1023​: warning​: previous declaration of `morecore'
malloc.c​:1391​: warning​: type mismatch with previous implicit
declaration
malloc.c​:1023​: warning​: previous implicit declaration of `morecore'
malloc.c​:1391​: warning​: `morecore' was previously implicitly declared to return `int'
malloc.c​:1391​: warning​: `morecore' was declared implicitly `extern' and later `static'

This shuts gcc up​:

Inline Patch
--- perl5.5.660/malloc.c-as-received	Tue Feb 22 10:19:53 2000
+++ perl5.5.660/malloc.c	Wed Feb 23 21:12:44 2000
@@ -972,6 +972,7 @@ Perl_malloc(register size_t nbytes)
   	register union overhead *p;
   	register int bucket;
   	register MEM_SIZE shiftr;
+	static void morecore(int bucket);
 
 #if defined(DEBUGGING) || defined(RCHECK)
 	MEM_SIZE size = nbytes;
Perl Info


Site configuration information for perl v5.5.660:

Configured by domo at Wed Feb 23 17:22:21 WET 2000.

Summary of my perl5 (revision 5.0 version 5 subversion 660) configuration:
  Platform:
    osname=machten, osvers=4.1.4, archname=powerpc-machten
    uname='machten ppp100 5 0.5 powerpc '
    config_args='-Doptimize=-g -de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
    usesocks=undef useperlio=undef d_sfio=undef
    use64bits=undef uselargefiles=define usemultiplicity=undef
  Compiler:
    cc='cc', optimize='-g', gccversion=2.8.1
    cppflags='-DNOTDEF_MACHTEN -DREG_INFTY=2047 -DDEBUGGING -I/usr/local/include'
    ccflags ='-DNOTDEF_MACHTEN -DREG_INFTY=2047 -DDEBUGGING -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -Xlstack=1048576 -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-lndbm -lgdbm -ldb -lm -lc
    libc=/usr/lib/libc.a, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags=''
    cccdlflags='', lddlflags=''

Locally applied patches:
    


@INC for perl v5.5.660:
    lib
    /usr/local/lib/perl5/5.5.660/powerpc-machten
    /usr/local/lib/perl5/5.5.660
    /usr/local/lib/perl5/site_perl/5.00557/powerpc-machten
    /usr/local/lib/perl5/site_perl/5.00557
    /usr/local/lib/perl5/site_perl/5.00556/powerpc-machten
    /usr/local/lib/perl5/site_perl/5.00556
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.5.660:
    HOME=/home/domo
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/lib
    LOGDIR (unset)
    PATH=/sbin:/usr/sbin:/home/domo/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11/bin:/usr/libexec
    PERL_BADLANG (unset)
    SHELL=/bin/bash
-- 
Dominic Dunlop


@p5pRT
Copy link
Author

p5pRT commented Feb 23, 2000

From @jhi

+ static void morecore(int bucket);

Applied. Thanks.

--
$jhi++; # http​://www.iki.fi/jhi/
  # There is this special biologist word we use for 'stable'.
  # It is 'dead'. -- Jack Cohen

@p5pRT
Copy link
Author

p5pRT commented Feb 24, 2000

From @gsar

On Wed, 23 Feb 2000 21​:23​:44 +0100, Dominic Dunlop wrote​:

On compiling malloc.c, I see

malloc.c​:1391​: warning​: `morecore' was declared implicitly `extern' and later `static'
malloc.c​:1023​: warning​: previous declaration of `morecore'
malloc.c​:1391​: warning​: type mismatch with previous implicit
declaration
malloc.c​:1023​: warning​: previous implicit declaration of `morecore'
malloc.c​:1391​: warning​: `morecore' was previously implicitly declared to return `int'
malloc.c​:1391​: warning​: `morecore' was declared implicitly `extern' and later `static'

This shuts gcc up​:

--- perl5.5.660/malloc.c-as-received Tue Feb 22 10​:19​:53 2000
+++ perl5.5.660/malloc.c Wed Feb 23 21​:12​:44 2000
@​@​ -972,6 +972,7 @​@​ Perl_malloc(register size_t nbytes)
register union overhead *p;
register int bucket;
register MEM_SIZE shiftr;
+ static void morecore(int bucket);

I think the earlier declaration of morecore() and other relevant
functions should be moved out of the PERL_EMERGENCY_SBRK guard instead.

Sarathy
gsar@​ActiveState.com

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