diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-09-21 12:08:47 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-09-21 07:54:10 +0000 |
commit | b57a0404d6b6347be89474e64fcdac6ac6ea98db (patch) | |
tree | acdc5f5e654b84d9d6ecc8464e9ca179e7c71359 | |
parent | fab43c1bb262944cb8f1d820af87e47b89cd3e12 (diff) | |
download | perl-b57a0404d6b6347be89474e64fcdac6ac6ea98db.tar.gz |
deal with some gcc warnings
Message-ID: <45122C6F.9080904@iki.fi>
p4raw-id: //depot/perl@28877
-rw-r--r-- | doio.c | 2 | ||||
-rw-r--r-- | reentr.c | 6 | ||||
-rw-r--r-- | reentr.pl | 2 | ||||
-rw-r--r-- | regcomp.c | 4 | ||||
-rw-r--r-- | regexec.c | 4 | ||||
-rw-r--r-- | sv.c | 1 | ||||
-rw-r--r-- | toke.c | 4 | ||||
-rw-r--r-- | util.c | 2 |
8 files changed, 14 insertions, 11 deletions
@@ -1333,6 +1333,8 @@ Perl_my_stat(pTHX) Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat"); return PL_laststatval; } + /* Should we warn/croak here? Or do something smart/useful? */ + return (PL_laststatval = -1); } @@ -44,7 +44,7 @@ Perl_reentrant_size(pTHX) { #ifdef HAS_GETGRNAM_R # if defined(HAS_SYSCONF) && defined(_SC_GETGR_R_SIZE_MAX) && !defined(__GLIBC__) PL_reentrant_buffer->_grent_size = sysconf(_SC_GETGR_R_SIZE_MAX); - if (PL_reentrant_buffer->_grent_size == -1) + if ((IV)PL_reentrant_buffer->_grent_size == (IV)-1) PL_reentrant_buffer->_grent_size = REENTRANTUSUALSIZE; # else # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ) @@ -79,7 +79,7 @@ Perl_reentrant_size(pTHX) { #ifdef HAS_GETPWNAM_R # if defined(HAS_SYSCONF) && defined(_SC_GETPW_R_SIZE_MAX) && !defined(__GLIBC__) PL_reentrant_buffer->_pwent_size = sysconf(_SC_GETPW_R_SIZE_MAX); - if (PL_reentrant_buffer->_pwent_size == -1) + if ((IV)PL_reentrant_buffer->_pwent_size == (IV)-1) PL_reentrant_buffer->_pwent_size = REENTRANTUSUALSIZE; # else # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ) @@ -101,7 +101,7 @@ Perl_reentrant_size(pTHX) { #ifdef HAS_GETSPNAM_R # if defined(HAS_SYSCONF) && defined(_SC_GETPW_R_SIZE_MAX) && !defined(__GLIBC__) PL_reentrant_buffer->_spent_size = sysconf(_SC_GETPW_R_SIZE_MAX); - if (PL_reentrant_buffer->_spent_size == -1) + if ((IV)PL_reentrant_buffer->_spent_size == (IV)-1) PL_reentrant_buffer->_spent_size = REENTRANTUSUALSIZE; # else # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ) @@ -547,7 +547,7 @@ EOF push @size, <<EOF; # if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__) PL_reentrant_buffer->$sz = sysconf($sc); - if (PL_reentrant_buffer->$sz == -1) + if ((IV)PL_reentrant_buffer->$sz == (IV)-1) PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE; # else # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ) @@ -1756,8 +1756,8 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs #ifdef DEBUGGING - U32 mjd_offset; - U32 mjd_nodelen; + U32 mjd_offset = 0; + U32 mjd_nodelen = 0; #endif /* This means we convert either the first branch or the first Exact, @@ -474,7 +474,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, #ifdef DEBUGGING /* 7/99: reports of failure (with the older version) */ if (end_shift < 0) Perl_croak(aTHX_ "panic: end_shift: %"IVdf" pattern:\n%s\n ", - end_shift,prog->precomp); + (IV)end_shift, prog->precomp); #endif restart: @@ -868,7 +868,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos, endpos= strend; DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "start_shift: %"IVdf" check_at: %d s: %d endpos: %d\n", - start_shift,check_at-strbeg,s-strbeg,endpos-strbeg)); + (IV)start_shift, check_at - strbeg, s - strbeg, endpos - strbeg)); t = s; s = find_byclass(prog, prog->regstclass, s, endpos, NULL); @@ -1851,6 +1851,7 @@ STATIC int S_sv_2iuv_non_preserve(pTHX_ register SV *sv, I32 numtype) { dVAR; + PERL_UNUSED_ARG(numtype); /* Used only under DEBUGGING? */ DEBUG_c(PerlIO_printf(Perl_debug_log,"sv_2iuv_non '%s', IV=0x%"UVxf" NV=%"NVgf" inttype=%"UVXf"\n", SvPVX_const(sv), SvIVX(sv), SvNVX(sv), (UV)numtype)); if (SvNVX(sv) < (NV)IV_MIN) { (void)SvIOKp_on(sv); @@ -2193,8 +2193,8 @@ S_scan_const(pTHX_ char *start) s += 3; len = e - s; uv = grok_hex(s, &len, &flags, NULL); - if ( len != e - s ) { - uv=0xFFFD; + if ( e > s && len != (STRLEN)(e - s) ) { + uv = 0xFFFD; } s = e + 1; goto NUM_ESCAPE_INSERT; @@ -5475,7 +5475,7 @@ Perl_my_clearenv(pTHX) char *buf = (char*)safesysmalloc(bufsiz); while (*environ != NULL) { char *e = strchr(*environ, '='); - int l = e ? e - *environ : strlen(*environ); + int l = e ? e - *environ : (int)strlen(*environ); if (bsiz < l + 1) { (void)safesysfree(buf); bsiz = l + 1; /* + 1 for the \0. */ |