From: H.Merijn Brand Date: Tue, 8 Jul 2008 12:02:48 +0000 (+0000) Subject: Be sure to use the correct type, so bits do not get wrapped X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5bcaa86b3b74d7972c51a495c7a8c358e9515fd8;p=p5sagit%2Fp5-mst-13.2.git Be sure to use the correct type, so bits do not get wrapped p4raw-id: //depot/perl@34112 --- diff --git a/Configure b/Configure index 1a9b290..939bcfc 100755 --- a/Configure +++ b/Configure @@ -25,7 +25,7 @@ # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ # -# Generated on Mon Jul 7 22:34:20 CEST 2008 [metaconfig 3.5 PL0] +# Generated on Tue Jul 8 13:24:59 CEST 2008 [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <tm_year < y) { i--; - printf ("%d\n", pt); + printf ("%ld\n", pt); return (i); } y = tmp->tm_year; pt = t; } - printf ("%d\n", pt); + printf ("%ld\n", pt); return (0); } EOCP @@ -20056,18 +20056,18 @@ int main () { time_t pt = 0; for (i = 0; i < 78; i++) { - time_t t = - (1 << i); + time_t t = - ((time_t)1 << i); tmp = gmtime (&t); if (tmp == NULL || tmp->tm_year > y) { i--; - printf ("%d\n", pt); + printf ("%ld\n", pt); return (i); } y = tmp->tm_year; pt = t; } - printf ("%d\n", pt); + printf ("%ld\n", pt); return (0); } EOCP diff --git a/Porting/Glossary b/Porting/Glossary index 64d1e5e..337e27e 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -3655,7 +3655,7 @@ make_set_make (make.U): make_set_make="MAKE=$make" # if it doesn't. - This uses a comment character to distinguish a + This uses a comment character so that we can distinguish a 'set' value (from a previous config.sh or Configure '-D' option) from an uncomputed value. diff --git a/Porting/config.sh b/Porting/config.sh index 8556888..e9cef88 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -496,6 +496,7 @@ d_tcsetpgrp='define' d_telldir='define' d_telldirproto='define' d_time='define' +d_timegm='define' d_times='define' d_tm_tm_gmtoff='define' d_tm_tm_zone='define' @@ -883,6 +884,8 @@ rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' rmail='' run='' runnm='false' +sGMTIME_max='2147483647' +sGMTIME_min='-2147483648' sPRIEUldbl='"LE"' sPRIFUldbl='"LF"' sPRIGUldbl='"LG"' diff --git a/Porting/config_H b/Porting/config_H index f74dc67..5caaaa2 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -17,9 +17,9 @@ /* * Package name : perl5 * Source directory : . - * Configuration time: Wed Jan 23 09:43:56 CET 2008 + * Configuration time: Tue Jul 8 13:49:11 CEST 2008 * Configured by : merijn - * Target system : linux nb09 2.6.22.13-0.3-default #1 smp 20071119 15:02:58 utc i686 i686 i386 gnulinux + * Target system : linux nb09 2.6.22.18-0.2-default #1 smp 2008-06-09 13:53:20 +0200 i686 i686 i386 gnulinux */ #ifndef _config_h_ @@ -72,6 +72,12 @@ */ /*#define HAS_CHSIZE / **/ +/* HAS_CRYPT: + * This symbol, if defined, indicates that the crypt routine is available + * to encrypt passwords and the like. + */ +#define HAS_CRYPT /**/ + /* HAS_CTERMID: * This symbol, if defined, indicates that the ctermid routine is * available to generate filename for terminal. @@ -105,6 +111,26 @@ */ #define HAS_DLERROR /**/ +/* SETUID_SCRIPTS_ARE_SECURE_NOW: + * This symbol, if defined, indicates that the bug that prevents + * setuid scripts from being secure is not present in this kernel. + */ +/* DOSUID: + * This symbol, if defined, indicates that the C program should + * check the script that it is executing for setuid/setgid bits, and + * attempt to emulate setuid/setgid on systems that have disabled + * setuid #! scripts because the kernel can't do it securely. + * It is up to the package designer to make sure that this emulation + * is done securely. Among other things, it should do an fstat on + * the script it just opened to make sure it really is a setuid/setgid + * script, it should make sure the arguments passed correspond exactly + * to the argument on the #! line, and it should not trust any + * subprocesses to which it must pass the filename rather than the + * file descriptor of the script to be executed. + */ +/*#define SETUID_SCRIPTS_ARE_SECURE_NOW / **/ +/*#define DOSUID / **/ + /* HAS_DUP2: * This symbol, if defined, indicates that the dup2 routine is * available to duplicate file descriptors. @@ -348,6 +374,13 @@ */ #define HAS_PIPE /**/ +/* HAS_POLL: + * This symbol, if defined, indicates that the poll routine is + * available to poll active file descriptors. Please check I_POLL and + * I_SYS_POLL to know which header should be included as well. + */ +#define HAS_POLL /**/ + /* HAS_READDIR: * This symbol, if defined, indicates that the readdir routine is * available to read directory entries. You may have to include @@ -412,6 +445,13 @@ */ #define HAS_SETEUID /**/ +/* HAS_SETGROUPS: + * This symbol, if defined, indicates that the setgroups() routine is + * available to set the list of process groups. If unavailable, multiple + * groups are probably not supported. + */ +#define HAS_SETGROUPS /**/ + /* HAS_SETLINEBUF: * This symbol, if defined, indicates that the setlinebuf routine is * available to change stderr or stdout from block-buffered or unbuffered @@ -606,6 +646,19 @@ */ #define HAS_WCTOMB /**/ +/* Groups_t: + * This symbol holds the type used for the second argument to + * getgroups() and setgroups(). Usually, this is the same as + * gidtype (gid_t) , but sometimes it isn't. + * It can be int, ushort, gid_t, etc... + * It may be necessary to include to get any + * typedef'ed information. This is only required if you have + * getgroups() or setgroups().. + */ +#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) +#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ +#endif + /* I_ARPA_INET: * This symbol, if defined, indicates to the C program that it should * include to get inet_addr and friends declarations. @@ -620,7 +673,7 @@ * This symbol, if defined, indicates that exists and * should be included. */ -/*#define I_DBM / **/ +#define I_DBM /**/ /*#define I_RPCSVC_DBM / **/ /* I_DLFCN: @@ -737,6 +790,13 @@ */ #define I_SYS_PARAM /**/ +/* I_SYS_POLL: + * This symbol, if defined, indicates that the program may include + * . When I_POLL is also defined, it's probably safest + * to only include . + */ +#define I_SYS_POLL /**/ + /* I_SYS_RESOURCE: * This symbol, if defined, indicates to the C program that it should * include . @@ -877,7 +937,7 @@ * feature tests from Configure are generally more reliable. */ #define OSNAME "linux" /**/ -#define OSVERS "2.6.22.13-0.3-default" /**/ +#define OSVERS "2.6.22.18-0.2-default" /**/ /* ARCHLIB: * This variable, if defined, holds the name of the directory in @@ -892,8 +952,8 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "/opt/perl/lib/5.11.0/i686-linux-64int" /**/ -#define ARCHLIB_EXP "/opt/perl/lib/5.11.0/i686-linux-64int" /**/ +#define ARCHLIB "/pro/lib/perl5/5.11.0/i686-linux-64int" /**/ +#define ARCHLIB_EXP "/pro/lib/perl5/5.11.0/i686-linux-64int" /**/ /* ARCHNAME: * This symbol holds a string representing the architecture name. @@ -915,8 +975,8 @@ * This symbol, if defined, indicates that we'd like to relocate entries * in @INC at run time based on the location of the perl binary. */ -#define BIN "/opt/perl/bin" /**/ -#define BIN_EXP "/opt/perl/bin" /**/ +#define BIN "/pro/bin" /**/ +#define BIN_EXP "/pro/bin" /**/ #define PERL_RELOCATABLE_INC "undef" /**/ /* CAT2: @@ -928,19 +988,16 @@ #if 42 == 1 #define CAT2(a,b) a/**/b #define STRINGIFY(a) "a" - /* If you can get stringification with catify, tell me how! */ #endif #if 42 == 42 #define PeRl_CaTiFy(a, b) a ## b #define PeRl_StGiFy(a) #a -/* the additional level of indirection enables these macros to be - * used as arguments to other macros. See K&R 2nd ed., page 231. */ #define CAT2(a,b) PeRl_CaTiFy(a,b) #define StGiFy(a) PeRl_StGiFy(a) #define STRINGIFY(a) PeRl_StGiFy(a) #endif #if 42 != 1 && 42 != 42 -# include "Bletch: How does this C preprocessor concatenate tokens?" +#include "Bletch: How does this C preprocessor concatenate tokens?" #endif /* CPPSTDIN: @@ -1043,12 +1100,6 @@ #define const #endif -/* HAS_CRYPT: - * This symbol, if defined, indicates that the crypt routine is available - * to encrypt passwords and the like. - */ -#define HAS_CRYPT /**/ - /* HAS_CRYPT_R: * This symbol, if defined, indicates that the crypt_r routine * is available to crypt re-entrantly. @@ -1070,7 +1121,7 @@ */ #define HAS_CSH /**/ #ifdef HAS_CSH -#define CSH "/usr/bin/csh" /**/ +#define CSH "/usr/bin/tcsh" /**/ #endif /* HAS_CTERMID_R: @@ -1099,26 +1150,6 @@ /*#define HAS_CTIME_R / **/ #define CTIME_R_PROTO 0 /**/ -/* SETUID_SCRIPTS_ARE_SECURE_NOW: - * This symbol, if defined, indicates that the bug that prevents - * setuid scripts from being secure is not present in this kernel. - */ -/* DOSUID: - * This symbol, if defined, indicates that the C program should - * check the script that it is executing for setuid/setgid bits, and - * attempt to emulate setuid/setgid on systems that have disabled - * setuid #! scripts because the kernel can't do it securely. - * It is up to the package designer to make sure that this emulation - * is done securely. Among other things, it should do an fstat on - * the script it just opened to make sure it really is a setuid/setgid - * script, it should make sure the arguments passed correspond exactly - * to the argument on the #! line, and it should not trust any - * subprocesses to which it must pass the filename rather than the - * file descriptor of the script to be executed. - */ -/*#define SETUID_SCRIPTS_ARE_SECURE_NOW / **/ -/*#define DOSUID / **/ - /* HAS_DRAND48_R: * This symbol, if defined, indicates that the drand48_r routine * is available to drand48 re-entrantly. @@ -1355,7 +1386,7 @@ #define HAS_UNAME /**/ /*#define HAS_PHOSTNAME / **/ #ifdef HAS_PHOSTNAME -#define PHOSTNAME "" /* How to get the host name */ +#define PHOSTNAME "/bin/hostname" /* How to get the host name */ #endif /* HAS_GETHOSTBYADDR_R: @@ -1811,13 +1842,6 @@ */ #define HAS_MSG /**/ -/* HAS_POLL: - * This symbol, if defined, indicates that the poll routine is - * available to poll active file descriptors. Please check I_POLL and - * I_SYS_POLL to know which header should be included as well. - */ -#define HAS_POLL /**/ - /* OLD_PTHREAD_CREATE_JOINABLE: * This symbol, if defined, indicates how to create pthread * in joinable (aka undetached) state. NOTE: not defined @@ -1832,7 +1856,7 @@ * This symbol, if defined, indicates that the pthread_atfork routine * is available to setup fork handlers. */ -#define HAS_PTHREAD_ATFORK /**/ +/*#define HAS_PTHREAD_ATFORK / **/ /* HAS_PTHREAD_YIELD: * This symbol, if defined, indicates that the pthread_yield @@ -1917,13 +1941,6 @@ /*#define HAS_SETGRENT_R / **/ #define SETGRENT_R_PROTO 0 /**/ -/* HAS_SETGROUPS: - * This symbol, if defined, indicates that the setgroups() routine is - * available to set the list of process groups. If unavailable, multiple - * groups are probably not supported. - */ -#define HAS_SETGROUPS /**/ - /* HAS_SETHOSTENT: * This symbol, if defined, indicates that the sethostent() routine is * available. @@ -2323,19 +2340,6 @@ */ #define Gid_t gid_t /* Type for getgid(), etc... */ -/* Groups_t: - * This symbol holds the type used for the second argument to - * getgroups() and setgroups(). Usually, this is the same as - * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, gid_t, etc... - * It may be necessary to include to get any - * typedef'ed information. This is only required if you have - * getgroups() or setgroups().. - */ -#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) -#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ -#endif - /* I_DIRENT: * This symbol, if defined, indicates to the C program that it should * include . Using this symbol also triggers the definition @@ -2377,7 +2381,19 @@ * This symbol, if defined, indicates that exists and should * be included. */ -/*#define I_NDBM / **/ +/* I_GDBMNDBM: + * This symbol, if defined, indicates that exists and should + * be included. This was the location of the ndbm.h compatibility file + * in RedHat 7.1. + */ +/* I_GDBM_NDBM: + * This symbol, if defined, indicates that exists and should + * be included. This is the location of the ndbm.h compatibility file + * in Debian 4.0. + */ +#define I_NDBM /**/ +/*#define I_GDBMNDBM / **/ +/*#define I_GDBM_NDBM / **/ /* I_NETDB: * This symbol, if defined, indicates that exists and @@ -2578,8 +2594,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "/opt/perl/lib/5.11.0" /**/ -#define PRIVLIB_EXP "/opt/perl/lib/5.11.0" /**/ +#define PRIVLIB "/pro/lib/perl5/5.11.0" /**/ +#define PRIVLIB_EXP "/pro/lib/perl5/5.11.0" /**/ /* CAN_PROTOTYPE: * If defined, this macro indicates that the C compiler can handle @@ -2671,8 +2687,8 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "/opt/perl/lib/site_perl/5.11.0/i686-linux-64int" /**/ -#define SITEARCH_EXP "/opt/perl/lib/site_perl/5.11.0/i686-linux-64int" /**/ +#define SITEARCH "/pro/lib/perl5/site_perl/5.11.0/i686-linux-64int" /**/ +#define SITEARCH_EXP "/pro/lib/perl5/site_perl/5.11.0/i686-linux-64int" /**/ /* SITELIB: * This symbol contains the name of the private library for this package. @@ -2694,9 +2710,9 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "/opt/perl/lib/site_perl/5.11.0" /**/ -#define SITELIB_EXP "/opt/perl/lib/site_perl/5.11.0" /**/ -#define SITELIB_STEM "/opt/perl/lib/site_perl" /**/ +#define SITELIB "/pro/lib/perl5/site_perl/5.11.0" /**/ +#define SITELIB_EXP "/pro/lib/perl5/site_perl/5.11.0" /**/ +#define SITELIB_STEM "/pro/lib/perl5/site_perl" /**/ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. @@ -2717,12 +2733,6 @@ */ #define Sock_size_t socklen_t /**/ -/* STDCHAR: - * This symbol is defined to be the type of char used in stdio.h. - * It has the values "unsigned char" or "char". - */ -#define STDCHAR char /**/ - /* Uid_t_f: * This symbol defines the format string used for printing a Uid_t. */ @@ -3231,6 +3241,12 @@ */ /*#define EBCDIC / **/ +/* STDCHAR: + * This symbol is defined to be the type of char used in stdio.h. + * It has the values "unsigned char" or "char". + */ +#define STDCHAR char /**/ + /* HAS_ATOLF: * This symbol, if defined, indicates that the atolf routine is * available to convert strings into long doubles. @@ -3262,7 +3278,7 @@ * Can we handle GCC builtin for telling that certain values are more * likely */ -/*#define HAS_BUILTIN_EXPECT / **/ +#define HAS_BUILTIN_EXPECT /**/ #define HAS_BUILTIN_CHOOSE_EXPR /**/ /* HAS_C99_VARIADIC_MACROS: @@ -3318,7 +3334,7 @@ * to the program to supply one. A good guess is * extern int dbminit(char *); */ -/*#define HAS_DBMINIT_PROTO / **/ +#define HAS_DBMINIT_PROTO /**/ /* HAS_DIR_DD_FD: * This symbol, if defined, indicates that the the DIR* dirstream @@ -3925,6 +3941,12 @@ */ #define HAS_TELLDIR_PROTO /**/ +/* HAS_TIMEGM: + * This symbol, if defined, indicates that the timegm routine is + * available to do the opposite of gmtime () + */ +#define HAS_TIMEGM /**/ + /* U32_ALIGNMENT_REQUIRED: * This symbol, if defined, indicates that you must access * character data through U32-aligned pointers. @@ -4070,6 +4092,12 @@ */ /*#define I_LIBUTIL / **/ +/* I_MALLOCMALLOC: + * This symbol, if defined, indicates to the C program that it should + * include . + */ +/*#define I_MALLOCMALLOC / **/ + /* I_MNTENT: * This symbol, if defined, indicates that exists and * should be included. @@ -4271,7 +4299,7 @@ * This symbol contains the number of bits a variable of type NVTYPE * can preserve of a variable of type UVTYPE. */ -/* NV_OVERFLOWS_INTEGERS_AT +/* NV_OVERFLOWS_INTEGERS_AT: * This symbol gives the largest integer value that NVs can hold. This * value + 1.0 cannot be stored accurately. It is expressed as constant * floating point expression to reduce the chance of decimale/binary @@ -4380,7 +4408,7 @@ * script to make sure (one hopes) that it runs with perl and not * some shell. */ -#define STARTPERL "#!/opt/perl/bin/perl5.11.0" /**/ +#define STARTPERL "#!/pro/bin/perl5.11.0" /**/ /* HAS_STDIO_STREAM_ARRAY: * This symbol, if defined, tells that there is an array @@ -4391,7 +4419,20 @@ * Usual values include _iob, __iob, and __sF. */ /*#define HAS_STDIO_STREAM_ARRAY / **/ +#ifdef HAS_STDIO_STREAM_ARRAY #define STDIO_STREAM_ARRAY +#endif + +/* GMTIME_MAX: + * This symbol contains the maximum value for the time_t offset that + * the system function gmtime () accepts, and defaults to 0 + */ +/* GMTIME_MIN: + * This symbol contains the minimum value for the time_t offset that + * the system function gmtime () accepts, and defaults to 0 + */ +#define GMTIME_MAX 2147483647 /**/ +#define GMTIME_MIN -2147483648 /**/ /* USE_64_BIT_INT: * This symbol, if defined, indicates that 64-bit integers should