Trunk: バグを指摘瘢雹している警告


#1

trunk e$B$Ge(B -Wall
e$B$rIU$1$F%3%s%Q%$%k$7$F$_$k$H!"%P%0$r;XE&$7$F$$$k7Y9p$,e(B
e$B$$$/$D$+8+IU$+$j$^$7$?!#e(B

compiling digest
gcc -I. -I//.ext/include/i386-freebsd6.2 -I//./include
-I//./ext/digest -DRUBY_EXTCONF_H=extconf.h -fPIC -g -O2 -Wall
-c digest.c
digest.c: In function rb_digest_instance_update': digest.c:100: warning: format argument is not a pointer (arg 3) digest.c: In functionrb_digest_instance_finish:
digest.c:118: warning: format argument is not a pointer (arg 3)
digest.c: In function rb_digest_instance_reset': digest.c:132: warning: format argument is not a pointer (arg 3) digest.c: In functionrb_digest_instance_block_length:
digest.c:361: warning: format argument is not a pointer (arg 3)
digest.c: In function rb_digest_class_s_digest': compiling dl gcc -I. -I../../.ext/include/i386-freebsd6.2 -I../.././include -I../.././ext/dl -DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -g -O2 -Wall -fno-defer-pop -fno-omit-frame-pointer -c cfunc.c cfunc.c: In functionrb_dlcfunc_call:
cfunc.c:463: warning: unsigned int format, ID arg (arg 3)
compiling openssl
gcc -I. -I//.ext/include/i386-freebsd6.2 -I//./include
-I//./ext/openssl -DRUBY_EXTCONF_H=extconf.h -fPIC -g -O2 -Wall
-c ossl_x509name.c
ossl_x509name.c: In function `ossl_x509name_to_s:
ossl_x509name.c:207: warning: null format string
ossl_x509name.c:211: warning: null format string

ext/openssl e$B$Ne(B
ossl_x509name.c:207: warning: null format string
ossl_x509name.c:211: warning: null format string
e$B$O!"e(B

  • rb_raise(eX509NameError, NULL);
  • rb_raise(eX509NameError, );
    e$B$K$9$Y$-$+$I$&$+$h$/$o$+$j$^$;$s$,!"B>$r8+$k$He(B ossl_raise()
    e$B$r;H$&$D$b$je(B
    e$B$@$C$?$H;W$o$l$?$N$G!"e(Bossl_raise() e$B$KCV$-49$($^$7$?!#e(B

Index: ext/digest/digest.c

ext/digest/digest.c (e$B%j%S%8%g%se(B 12779)
+++ ext/digest/digest.c (e$B:n6H%3%T!<e(B)
@@ -97,7 +97,7 @@
static VALUE
rb_digest_instance_update(VALUE self, VALUE str)
{

  • rb_raise(rb_eRuntimeError, %s does not implement update(),
    rb_inspect(self));
  • rb_raise(rb_eRuntimeError, %s does not implement update(),
    RSTRING_PTR(rb_inspect(self)));
    }

/*
@@ -115,7 +115,7 @@
static VALUE
rb_digest_instance_finish(VALUE self)
{

  • rb_raise(rb_eRuntimeError, %s does not implement finish(),
    rb_inspect(self));
  • rb_raise(rb_eRuntimeError, %s does not implement finish(),
    RSTRING_PTR(rb_inspect(self)));
    }

/*
@@ -129,7 +129,7 @@
static VALUE
rb_digest_instance_reset(VALUE self)
{

  • rb_raise(rb_eRuntimeError, %s does not implement reset(),
    rb_inspect(self));
  • rb_raise(rb_eRuntimeError, %s does not implement reset(),
    RSTRING_PTR(rb_inspect(self)));
    }

/*
@@ -358,7 +358,7 @@
static VALUE
rb_digest_instance_block_length(VALUE self)
{

  • rb_raise(rb_eRuntimeError, %s does not implement block_length(),
    rb_inspect(self));
  • rb_raise(rb_eRuntimeError, %s does not implement block_length(),
    RSTRING_PTR(rb_inspect(self)));
    }

/*
Index: ext/dl/cfunc.c

ext/dl/cfunc.c (e$B%j%S%8%g%se(B 12779)
+++ ext/dl/cfunc.c (e$B:n6H%3%T!<e(B)
@@ -460,7 +460,11 @@
}
}
else{

  • rb_raise(rb_eDLError, unsupported call type: %x, cfunc->calltype);
    +#ifndef LONG_LONG_VALUE
  • rb_raise(rb_eDLError, unsupported call type: %lx, cfunc->calltype);
    +#else

  • rb_raise(rb_eDLError, unsupported call type: %llx,
    cfunc->calltype);
    +#endif
    }

    rb_dl_set_last_error(self, INT2NUM(errno));
    Index: ext/openssl/ossl_x509name.c
    ===================================================================
    ext/openssl/ossl_x509name.c (e$B%j%S%8%g%se(B 12779)
    +++ ext/openssl/ossl_x509name.c (e$B:n6H%3%T!<e(B)
    @@ -204,11 +204,11 @@
    return ossl_x509name_to_s_old(self);
    else iflag = NUM2ULONG(flag);
    if (!(out = BIO_new(BIO_s_mem())))

  • rb_raise(eX509NameError, NULL);
  • ossl_raise(eX509NameError, NULL);
    GetX509Name(self, name);
    if (!X509_NAME_print_ex(out, name, 0, iflag)){
    BIO_free(out);
  • rb_raise(eX509NameError, NULL);
  • ossl_raise(eX509NameError, NULL);
    }
    str = ossl_membio2str(out);

#2

From: pegacorn removed_email_address@domain.invalid
Date: Sat, 14 Jul 2007 20:00:01 +0900
Message-Id: removed_email_address@domain.invalid
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

trunk e$B$Ge(B -Wall e$B$rIU$1$F%3%s%Q%$%k$7$F$_$k$H!"%P%0$r;XE&$7$F$$$k7Y9p$,e(B
e$B$$$/$D$+8+IU$+$j$^$7$?!#e(B

e$BDI2C$G$9!#e(B
e$B!J:#2s$N$O!"$?$V$sF0:n$K1F6A$9$k=hM}7O$OL5$$$H;W$$$^$9$,!D!Ke(B

compiling openssl
gcc -I. -I//.ext/include/i386-freebsd6.2 -I//./include
-I//./ext/openssl -DRUBY_EXTCONF_H=extconf.h -fPIC -g -O2 -Wall
-c ossl.c
ossl.c: In function Init_openssl': ossl.c:476: warning: implicit declaration of functionInit_ossl_pkcs5
compiling syck
gcc -I. -I//.ext/include/i386-freebsd6.2 -I//./include
-I//./ext/syck -DRUBY_EXTCONF_H=extconf.h -fPIC -g -O2 -Wall -c
rubyext.c
rubyext.c: In function syck_set_model': rubyext.c:682: warning: implicit declaration of functionsyck_parser_set_input_type

Index: ext/openssl/ossl.h

ext/openssl/ossl.h (e$B%j%S%8%g%se(B 12788)
+++ ext/openssl/ossl.h (e$B:n6H%3%T!<e(B)
@@ -203,6 +203,7 @@
#include ossl_ocsp.h
#include ossl_pkcs12.h
#include ossl_pkcs7.h
+#include ossl_pkcs5.h
#include ossl_pkey.h
#include ossl_rand.h
#include ossl_ssl.h
Index: ext/openssl/ossl_pkcs5.h

ext/openssl/ossl_pkcs5.h (e$B%j%S%8%g%se(B 0)
+++ ext/openssl/ossl_pkcs5.h (e$B%j%S%8%g%se(B 0)
@@ -0,0 +1,6 @@
+#if !defined(OSSL_PKCS5_H)
+#define OSSL_PKCS5_H
+
+void Init_ossl_pkcs5(void);
+
+#endif /* OSSL_PKCS5_H */
Index: ext/syck/syck.h

ext/syck/syck.h (e$B%j%S%8%g%se(B 12788)
+++ ext/syck/syck.h (e$B:n6H%3%T!<e(B)
@@ -399,6 +399,7 @@
void syck_parser_handler( SyckParser *, SyckNodeHandler );
void syck_parser_error_handler( SyckParser *, SyckErrorHandler );
void syck_parser_bad_anchor_handler( SyckParser *, SyckBadAnchorHandler
);
+void syck_parser_set_input_type( SyckParser *, enum syck_parser_input
);
void syck_parser_file( SyckParser *, FILE *, SyckIoFileRead );
void syck_parser_str( SyckParser *, char *, long, SyckIoStrRead );
void syck_parser_str_auto( SyckParser *, char *, SyckIoStrRead );


#3

From: pegacorn removed_email_address@domain.invalid
Date: Sat, 14 Jul 2007 20:00:01 +0900
Message-Id: removed_email_address@domain.invalid
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

trunk e$B$Ge(B -Wall e$B$rIU$1$F%3%s%Q%$%k$7$F$_$k$H!"%P%0$r;XE&$7$F$$$k7Y9p$,e(B
e$B$$$/$D$+8+IU$+$j$^$7$?!#e(B

e$B:#EY$O!"e(Bmswin32 e$B4D6-$Ge(B -W3
e$B$rIU$1$F%3%s%Q%$%k$7$F$_$^$7$?!#e(B

cl -nologo -MD -Zi -W3 -O2b2xty- -DRUBY_EXPORT -I.
-I.ext/include/i386-mswin32_80 -I.//include -I./ -I.//missing
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -c -Tc.//util.c
util.c
.//util.c(630) : warning C4013: e$B4X?te(B rb_w32_getcwd
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
cl -nologo -MD -Zi -W3 -O2b2xty- -DRUBY_EXPORT -I.
-I.ext/include/i386-mswin32_80 -I.//include -I./ -I.//missing
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -c -Tcwin32.c
win32.c
win32.c(3369) : warning C4013: e$B4X?te(B _mbspbrk
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
cl -nologo -I. -I//.ext/include/i386-mswin32_80
-I//.//include -I//.//ext/sdbm -MD -Zi -W3 -O2b2xty-
-DRUBY_EXTCONF_H=extconf.h -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE -c -Tc//.//ext/sdbm/_sdbm.c
_sdbm.c
//.//ext/sdbm/_sdbm.c(201) : warning C4013: e$B4X?te(B open
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
//.//ext/sdbm/_sdbm.c(222) : warning C4013: e$B4X?te(B close
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
//.//ext/sdbm/_sdbm.c(268) : warning C4013: e$B4X?te(B lseek
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
//.//ext/sdbm/_sdbm.c(269) : warning C4013: e$B4X?te(B write
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
//.//ext/sdbm/_sdbm.c(443) : warning C4013: e$B4X?te(B read
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
cl -nologo -I. -I//.ext/include/i386-mswin32_80
-I//.//include -I//.//ext/syck -MD -Zi -W3 -O2b2xty-
-DRUBY_EXTCONF_H=extconf.h -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE -c -Tc//.//ext/syck/gram.c
gram.c
gram.c(1066) : warning C4013: e$B4X?te(B malloc
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B
gram.c(1074) : warning C4013: e$B4X?te(B free
e$B$ODj5A$5$l$F$$$^$;$s!#e(Bint e$B7?$NCM$rJV$930It4X?t$H8+$J$7$^$9!#e(B

ext/syck/gram.c e$B$G$N7Y9p$O!0J2<$NItJ,$Ge(B <stdlib.h> e$B$,e(B
#include
e$B$5$l$J$$$3$H$,860x$G$9$,!%=!<%9$,8+Ev$?$i$J$$$N$G%Q%C%A$O:n@.$7$F$$$^$;$s!#e(B
e$B$^$?!"e(Bmswin64 e$B4D6-$K$OBP1~$7$F$$$^$;$s!#e(B

|c|

ifdef YYSTACK_ALLOC

/* Pacify GCCs `empty if-body warning. */

define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)

else

if defined (STDC) || defined (__cplusplus)

include <stdlib.h> /* INFRINGES ON USER NAME SPACE */

define YYSIZE_T size_t

endif

define YYSTACK_ALLOC YYMALLOC

define YYSTACK_FREE YYFREE

endif

#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
||<

http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/vclang/html/_PREDIR_Predefined_Macros.asp

>>

STDC Indicates full conformance with the ANSI C standard.

Defined as the integer constant 1 only if

the /Za compiler option is given and

you are not compiling C++ code; otherwise is undefined.

<<

Index: ext/sdbm/_sdbm.c

ext/sdbm/_sdbm.c (revision 12788)
+++ ext/sdbm/_sdbm.c (working copy)
@@ -71,7 +71,7 @@

#include <stdio.h>
#include <stdlib.h>
-#ifdef MSDOS
+#if defined MSDOS || (defined _WIN32 && !defined CYGWIN)
#include <io.h>
#endif
#include <sys/types.h>
Index: include/ruby/win32.h

include/ruby/win32.h (revision 12788)
+++ include/ruby/win32.h (working copy)
@@ -237,6 +237,7 @@
extern struct servent *WSAAPI rb_w32_getservbyname(const char *, const
char *);
extern struct servent *WSAAPI rb_w32_getservbyport(int, const char *);
extern int rb_w32_socketpair(int, int, int, int *);
+extern char * rb_w32_getcwd(char *, int);
extern char * rb_w32_getenv(const char *);
extern int rb_w32_rename(const char *, const char *);
extern char **rb_w32_get_environ(void);
Index: win32/win32.c

win32/win32.c (revision 12788)
+++ win32/win32.c (working copy)
@@ -27,6 +27,7 @@
#include <wincon.h>
#include <share.h>
#include <shlobj.h>
+#include <mbstring.h>
#ifdef MINGW32
#include <mswsock.h>
#endif


#4

e$B$J$+$@$G$9!#e(B

At Sat, 14 Jul 2007 20:00:01 +0900,
pegacorn wrote in [ruby-dev:31222]:

trunk e$B$Ge(B -Wall e$B$rIU$1$F%3%s%Q%$%k$7$F$_$k$H!"%P%0$r;XE&$7$F$$$k7Y9p$,e(B
e$B$$$/$D$+8+IU$+$j$^$7$?!#e(B

[ruby-dev:31232]e$B$^$G$^$H$a$F%3%_%C%H$7$^$7$?!#e(B


#5

e$B$J$+$@$G$9!#e(B

At Sun, 15 Jul 2007 14:45:58 +0900,
pegacorn wrote in [ruby-dev:31232]:

Index: ext/sdbm/_sdbm.c

ext/sdbm/_sdbm.c (revision 12788)
+++ ext/sdbm/_sdbm.c (working copy)
@@ -71,7 +71,7 @@

#include <stdio.h>
#include <stdlib.h>
-#ifdef MSDOS
+#if defined MSDOS || (defined _WIN32 && !defined CYGWIN)

e$B$3$l$Oe(B #ifdef DOSISH e$B$G$$$$$+$b!#e(B


#6

From: Nobuyoshi N. removed_email_address@domain.invalid
Date: Sun, 15 Jul 2007 22:25:05 +0900
Message-Id:
removed_email_address@domain.invalid
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

At Sat, 14 Jul 2007 20:00:01 +0900,
pegacorn wrote in [ruby-dev:31222]:

trunk e$B$Ge(B -Wall e$B$rIU$1$F%3%s%Q%$%k$7$F$_$k$H!"%P%0$r;XE&$7$F$$$k7Y9p$,e(B
e$B$$$/$D$+8+IU$+$j$^$7$?!#e(B

[ruby-dev:31232]e$B$^$G$^$H$a$F%3%_%C%H$7$^$7$?!#e(B

e$B$"$j$,$H$&$4$6$$$^$9!#e(B

From: Nobuyoshi N. removed_email_address@domain.invalid
Date: Sun, 15 Jul 2007 16:30:36 +0900
Message-Id:
removed_email_address@domain.invalid
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

e$B$3$l$Oe(B #ifdef DOSISH e$B$G$$$$$+$b!#e(B

ruby/config.h e$B$7$+e(B #include e$B$7$F$$$J$$$N$G!"e(B
e$B$3$3$G$Oe(B DOSISH e$B$ODj5A$5$l$F$$$J$$$h$&$G$9!#e(B


#7

From: pegacorn removed_email_address@domain.invalid
Date: Sat, 14 Jul 2007 20:00:01 +0900
Message-Id: removed_email_address@domain.invalid
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

trunk e$B$Ge(B -Wall e$B$rIU$1$F%3%s%Q%$%k$7$F$_$k$H!"%P%0$r;XE&$7$F$$$k7Y9p$,e(B
e$B$$$/$D$+8+IU$+$j$^$7$?!#e(B

e$B:#EY$O!"e(Bcygwin e$B4D6-$Ge(B -Wall
e$B$rIU$1$F%3%s%Q%$%k$7$F$_$^$7$?!#e(B

gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I.
-DRUBY_EXPORT -c dln.c
dln.c: In function conv_to_posix_path': dln.c:1615: warning: implicit declaration of functioncygwin32_conv_to_posix_path
gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I.
-DRUBY_EXPORT -c file.c
file.c: In function rb_thread_flock': file.c:3102: warning: implicit declaration of functionGetLastError
gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I.
-DRUBY_EXPORT -c ruby.c
ruby.c: In function ruby_push_include': ruby.c:190: warning: implicit declaration of functionconv_to_posix_path
gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I.
-DRUBY_EXPORT -c ./missing/strftime.c
./missing/strftime.c: In function strftime': ./missing/strftime.c:448: warning: int format, long int arg (arg 3) ./missing/strftime.c:448: warning: int format, long int arg (arg 4) compiling Win32API gcc -I. -I../../.ext/include/i386-cygwin -I../.././include -I../.././ext/Win32API -DRUBY_EXTCONF_H=\"extconf.h\" -g -O2 -Wall -c Win32API.c Win32API.c: In functionWin32API_initialize:
Win32API.c:111: warning: int format, long int arg (arg 3)
compiling socket
gcc -I. -I//.ext/include/i386-cygwin -I//./include
-I//./ext/socket -DRUBY_EXTCONF_H=extconf.h -I. -g -O2 -Wall
-c getnameinfo.c
getnameinfo.c: In function inet_ntop': getnameinfo.c:126: warning: implicit declaration of functionsnprintf
compiling tk
gcc -I. -I//.ext/include/i386-cygwin -I//./include
-I//./ext/tk -DRUBY_EXTCONF_H=extconf.h -D_WIN32
-DWITH_TCL_ENABLE_THREAD=0 -g -O2 -Wall -c tcltklib.c
tcltklib.c: In function eventloop_sleep': tcltklib.c:1262: warning: implicit declaration of functionis_ruby_native_thread
tcltklib.c: In function ip_finalize': tcltklib.c:4411: warning: long unsigned int format, pointer arg (arg 3) compiling win32ole gcc -I. -I../../.ext/include/i386-cygwin -I../.././include -I../.././ext/win32ole -DRUBY_EXTCONF_H=\"extconf.h\" -g -O2 -Wall -c win32ole.c win32ole.c: In functionlcid_installed:
win32ole.c:2644: warning: unsigned int format, LCID arg (arg 4)

Index: dln.c

dln.c (revision 12800)
+++ dln.c (working copy)
@@ -69,6 +69,10 @@
char *getenv();
#endif

+#ifdef CYGWIN32
+#include <sys/cygwin.h>
+#endif
+
#if defined(__VMS)
#pragma builtins
#include <dlfcn.h>
@@ -1602,21 +1606,23 @@

#if defined(CYGWIN32)
const char *
-conv_to_posix_path(char *win32, char *posix, int len)
+conv_to_posix_path(const char *win32, char *posix, int len)
{

  • char *first = win32;
  • char *p = win32;
  • char *first;

  • char *p;
    char *dst = posix;

  • first = alloca(strlen(win32)+1);

  • strcpy(first, win32);

  • posix[0] = \0;

  • for (p = win32; *p; p++)
  • for (p = first; *p; p++)
    if (*p == ;) {
    *p = 0;
    cygwin32_conv_to_posix_path(first, posix);
    posix += strlen(posix);
    *posix++ = :;
    first = p + 1;
  •  *p = ';';
    
    }
    if (len < strlen(first))
    fprintf(stderr, PATH length too long: %s\n, first);
    Index: dln.h
    ===================================================================
    dln.h (revision 12800)
    +++ dln.h (working copy)
    @@ -31,6 +31,9 @@

char dln_find_exe(const char,const char*);
char dln_find_file(const char,const char*);
+#ifdef CYGWIN32
+const char *conv_to_posix_path(const char *, char *, int);
+#endif

#ifdef USE_DLN_A_OUT
extern char *dln_argv0;
Index: ext/socket/getnameinfo.c

ext/socket/getnameinfo.c (revision 12800)
+++ ext/socket/getnameinfo.c (working copy)
@@ -62,6 +62,9 @@
#include <stdio.h>
#define snprintf _snprintf
#endif
+#ifdef CYGWIN
+#include <stdio.h>
+#endif

#include <string.h>
#include <stddef.h>
Index: ext/tk/tcltklib.c

ext/tk/tcltklib.c (revision 12800)
+++ ext/tk/tcltklib.c (working copy)
@@ -4408,13 +4408,13 @@
}

 if (Tcl_InterpDeleted(ip)) {
  •    DUMP2("ip(%lx) is already deleted", ip);
    
  •    DUMP2("ip(%p) is already deleted", ip);
       return;
    
    }

#if TCL_NAMESPACE_DEBUG
if (ip_null_namespace(ip)) {

  •    DUMP2("ip(%lx) has null namespace", ip);
    
  •    DUMP2("ip(%p) has null namespace", ip);
       return;
    

    }
    #endif
    Index: ext/Win32API/Win32API.c
    ===================================================================
    ext/Win32API/Win32API.c (revision 12800)
    +++ ext/Win32API/Win32API.c (working copy)
    @@ -108,7 +108,7 @@
    }

    if (16 < RARRAY_LEN(a_import)) {

  • rb_raise(rb_eRuntimeError, too many parameters: %d\n,
    RARRAY_LEN(a_import));
  • rb_raise(rb_eRuntimeError, too many parameters: %ld\n,
    RARRAY_LEN(a_import));
    }

    rb_iv_set(self, import, a_import);
    Index: ext/win32ole/win32ole.c
    ===================================================================
    ext/win32ole/win32ole.c (revision 12800)
    +++ ext/win32ole/win32ole.c (working copy)
    @@ -2641,7 +2641,7 @@
    lcid_installed(LCID lcid)
    {
    g_lcid_installed = FALSE;

  • snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), %08x, lcid);
  • snprintf(g_lcid_to_check, sizeof(g_lcid_to_check), %08lx, lcid);
    EnumSystemLocales(installed_lcid_proc, LCID_INSTALLED);
    return g_lcid_installed;
    }
    Index: file.c
    ===================================================================
    file.c (revision 12800)
    +++ file.c (working copy)
    @@ -66,6 +66,11 @@
    #define lstat stat
    #endif

+#ifdef CYGWIN
+#include <windows.h>
+#include <winerror.h>
+#endif
+
#ifdef BEOS /* should not change ID if -1 */
static int
be_chown(const char *path, uid_t owner, gid_t group)
@@ -2215,7 +2220,6 @@
#endif
if (rename(src, dst) < 0) {
#if defined CYGWIN

  • extern unsigned long attribute((stdcall)) GetLastError(void);
    if (errno == 0) { /* This is a bug of old Cygwin /
    /
    incorrect as cygwin errno, but the last resort */
    errno = GetLastError();
    @@ -3086,10 +3090,6 @@

define LOCK_UN 8

endif

-#ifdef CYGWIN
-#include <winerror.h>
-#endif

static VALUE
rb_thread_flock(rb_thread_t *th, void *data)
{
Index: include/ruby/intern.h

include/ruby/intern.h (revision 12800)
+++ include/ruby/intern.h (working copy)
@@ -279,6 +279,7 @@
VALUE rb_thread_local_aset(VALUE, ID, VALUE);
void rb_thread_atfork(void);
VALUE rb_exec_recursive(VALUE()(VALUE, VALUE, int),VALUE,VALUE);
+VALUE is_ruby_native_thread(void);
/
file.c */
VALUE rb_file_s_expand_path(int, VALUE *);
VALUE rb_file_expand_path(VALUE, VALUE);
Index: missing/strftime.c

missing/strftime.c (revision 12800)
+++ missing/strftime.c (working copy)
@@ -445,7 +445,7 @@
} else {
tbuf[0] = +;
}

  •  sprintf(tbuf+1, "%02d%02d", off/60, off%60);
    
  •  sprintf(tbuf+1, "%02ld%02ld", off/60, off%60);
     break;
    

#endif /* MAILHEADER_EXT */


#8

From: pegacorn removed_email_address@domain.invalid
Date: Sat, 14 Jul 2007 20:00:01 +0900
Message-Id: removed_email_address@domain.invalid
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

trunk -Wall

ruby_1_8
trunk

// FreeBSD
compiling dl
gcc -I. -I/ -I//. -I//./ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN
-DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -I. -fPIC -g -O2 -Wall
-fno-defer-pop -fno-omit-frame-pointer -c ptr.c
ptr.c: In function rb_dlptr_inspect': ptr.c:470: warning: unsigned int format, pointer arg (arg 5) ptr.c:470: warning: unsigned int format, pointer arg (arg 6) ptr.c:470: warning: unsigned int format, freefunc_t arg (arg 8) gcc -I. -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -I. -fPIC -g -O2 -Wall -fno-defer-pop -fno-omit-frame-pointer -c sym.c sym.c: In functionrb_dlsym_inspect:
sym.c:272: warning: unsigned int format, pointer arg (arg 4)
sym.c:272: warning: unsigned int format, pointer arg (arg 5)
// Cygwin
compiling win32ole
gcc -I. -I/ -I//. -I//./ext/win32ole -DNONAMELESSUNION
-DHAVE_WINDOWS_H -g -O2 -Wall -c win32ole.c
win32ole.c: In function ole_hresult2msg': win32ole.c:500: warning: unsigned int format, HRESULT arg (arg 3) win32ole.c:4037: warning: return type defaults toint
win32ole.c:4081: warning: return type defaults to int' win32ole.c:4117: warning: return type defaults toint
win32ole.c:4163: warning: return type defaults to int' win32ole.c:4635: warning: return type defaults toint

Index: ext/dl/ptr.c

ext/dl/ptr.c ( 12820)
+++ ext/dl/ptr.c ()
@@ -466,8 +466,9 @@
char str[1024];

Data_Get_Struct(self, struct ptr_data, data);

  • snprintf(str, 1023, #<%s:0x%x ptr=0x%x size=%ld free=0x%x>,
  • rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, 
    

data->free);

  • snprintf(str, 1023, #<%s:0x%lx ptr=0x%lx size=%ld free=0x%lx>,
  • rb_class2name(CLASS_OF(self)), data, data->ptr, data->size,
    
  • (long)data->free);
    
    return rb_str_new2(str);
    }

Index: ext/dl/sym.c

ext/dl/sym.c ( 12820)
+++ ext/dl/sym.c ()
@@ -268,7 +268,7 @@
str_size = RSTRING(proto)->len + 100;
str = dlmalloc(str_size);
snprintf(str, str_size - 1,

  •      "#<DL::Symbol:0x%x func=0x%x '%s'>",
    
  •      "#<DL::Symbol:0x%lx func=0x%lx '%s'>",
    sym, sym->func, RSTRING(proto)->ptr);
    

    val = rb_tainted_str_new2(str);
    dlfree(str);
    Index: ext/win32ole/win32ole.c
    ===================================================================
    ext/win32ole/win32ole.c (revision 12820)
    +++ ext/win32ole/win32ole.c (working copy)
    @@ -497,7 +497,7 @@
    DWORD dwCount;

    char strhr[100];

  • sprintf(strhr, " HRESULT error code:0x%08x\n ", hr);
  • sprintf(strhr, " HRESULT error code:0x%08lx\n ", hr);
    msg = rb_str_new2(strhr);

    dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
    @@ -4033,7 +4033,8 @@
    return rb_ivar_get(self, rb_intern(name));
    }

-static ole_variable_ole_type(pTypeInfo, var_index)
+static VALUE
+ole_variable_ole_type(pTypeInfo, var_index)
ITypeInfo *pTypeInfo;
UINT var_index;
{
@@ -4077,7 +4078,8 @@
return ole_variable_ole_type(pvar->pTypeInfo, pvar->index);
}

-static ole_variable_ole_type_detail(pTypeInfo, var_index)
+static VALUE
+ole_variable_ole_type_detail(pTypeInfo, var_index)
ITypeInfo *pTypeInfo;
UINT var_index;
{
@@ -4113,7 +4115,8 @@
return ole_variable_ole_type_detail(pvar->pTypeInfo, pvar->index);
}

-static ole_variable_value(pTypeInfo, var_index)
+static VALUE
+ole_variable_value(pTypeInfo, var_index)
ITypeInfo *pTypeInfo;
UINT var_index;
{
@@ -4159,7 +4162,8 @@
return ole_variable_value(pvar->pTypeInfo, pvar->index);
}

-static ole_variable_visible(pTypeInfo, var_index)
+static VALUE
+ole_variable_visible(pTypeInfo, var_index)
ITypeInfo *pTypeInfo;
UINT var_index;
{
@@ -4631,7 +4635,8 @@
return ole_method_visible(pmethod->pTypeInfo, pmethod->index);
}

-static ole_method_event(pTypeInfo, method_index, method_name)
+static VALUE
+ole_method_event(pTypeInfo, method_index, method_name)
ITypeInfo *pTypeInfo;
WORD method_index;
VALUE method_name;


#9

e$B$J$+$@$G$9!#e(B

At Tue, 17 Jul 2007 17:05:53 +0900,
Nobuyoshi N. wrote in [ruby-dev:31241]:

conv_to_posix_path()e$B$O85$Oe(Bdln.ce$B$G$b;H$C$F$$$?$N$G$9$,!":#$Oe(B
ruby.ce$B$G$7$+;H$C$F$$$^$;$s!#e(Bruby.ce$B$K$=$N$^$^0\F0$7$F$b$$$$$+$be(B
e$B$7$l$^$;$s$,!":G8e$N%A%%C%/$O$J$s$@$+0UL#ITL@$@$7!"e(B
rubylib_manglee$B4X78$b$=$m$=$m>C$7$F$$$$$H;W$$$^$9!#e(B

e$B$d$O$je(BRUBYLIBe$B$de(B-Ie$B$GD9$$%Q%9$rM?$($k$H%9%?%C%/$rGK2u$7$FMn$A$k$Ne(B
e$B$G!"=$@5$7$^$9!#e(B

$ d=cygpath -wa ../ext/i386-cygwin
$ RUBYLIB="$d;$d;$d;$d;$d;$d;$d;$d" ruby -e p $:
-e: [BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i386-cygwin]

Hangup

e$B$o$?$J$Y$5$s$O!"e(BPOSIX pathe$B$X$NJQ49<+BN$r$d$a$K$7$?$$$=$&$G$9$,!#e(B

e$B$R$H$^$:e(Bmanglee$B$b4^$a$FF1$8F0:n$r$9$k$h$&$K$7$F$*$-$^$9!#e(B


#10

e$B$J$+$@$G$9!#e(B

At Mon, 16 Jul 2007 21:23:01 +0900,
pegacorn wrote in [ruby-dev:31239]:

e$B:#EY$O!"e(Bcygwin e$B4D6-$Ge(B -Wall e$B$rIU$1$F%3%s%Q%$%k$7$F$_$^$7$?!#e(B

gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I. -DRUBY_EXPORT -c dln.c
dln.c: In function conv_to_posix_path': dln.c:1615: warning: implicit declaration of functioncygwin32_conv_to_posix_path
gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I. -DRUBY_EXPORT -c ruby.c
ruby.c: In function ruby_push_include': ruby.c:190: warning: implicit declaration of functionconv_to_posix_path

conv_to_posix_path()e$B$O85$Oe(Bdln.ce$B$G$b;H$C$F$$$?$N$G$9$,!":#$Oe(B
ruby.ce$B$G$7$+;H$C$F$$$^$;$s!#e(Bruby.ce$B$K$=$N$^$^0\F0$7$F$b$$$$$+$be(B
e$B$7$l$^$;$s$,!":G8e$N%A%%C%/$O$J$s$@$+0UL#ITL@$@$7!"e(B
rubylib_manglee$B4X78$b$=$m$=$m>C$7$F$$$$$H;W$$$^$9!#e(B

e$B$o$?$J$Y$5$s$O!"e(BPOSIX
pathe$B$X$NJQ49<+BN$r$d$a$K$7$?$$$=$&$G$9$,!#e(B

gcc -g -O2 -Wall -I. -I.ext/include/i386-cygwin -I./include -I. -DRUBY_EXPORT -c ./missing/strftime.c
./missing/strftime.c: In function `strftime:
./missing/strftime.c:448: warning: int format, long int arg (arg 3)
./missing/strftime.c:448: warning: int format, long int arg (arg 4)

e$B$3$l$O5U$KCM$N$[$&$r%-%c%9%H$7$F$b$$$$$h$&$J!#e(B

compiling socket
gcc -I. -I//.ext/include/i386-cygwin -I//./include -I//./ext/socket -DRUBY_EXTCONF_H=extconf.h -I. -g -O2 -Wall -c getnameinfo.c
getnameinfo.c: In function inet_ntop': getnameinfo.c:126: warning: implicit declaration of functionsnprintf

stdio.he$B$/$i$$$O>o$K%$%s%/%k!<%I$7$F$$$$$s$8$c$J$$$G$7$g$&$+!#e(B

compiling tk
gcc -I. -I//.ext/include/i386-cygwin -I//./include -I//./ext/tk -DRUBY_EXTCONF_H=extconf.h -D_WIN32 -DWITH_TCL_ENABLE_THREAD=0 -g -O2 -Wall -c tcltklib.c
tcltklib.c: In function eventloop_sleep': tcltklib.c:1262: warning: implicit declaration of functionis_ruby_native_thread

e$B$3$l$O1J0f$5$s$,$J$K$+$$$C$F$^$;$s$G$7$?$C$1!#e(B

Index: dln.c

dln.c (revision 12804)
+++ dln.c (working copy)
@@ -1601,30 +1601,4 @@ dln_find_file(const char *fname, const c
}

-#if defined(CYGWIN32)
-const char *
-conv_to_posix_path(char *win32, char *posix, int len)
-{

  • char *first = win32;
  • char *p = win32;
  • char *dst = posix;
  • posix[0] = \0;
  • for (p = win32; *p; p++)
  • if (*p == ;) {
  •  *p = 0;
    
  •  cygwin32_conv_to_posix_path(first, posix);
    
  •  posix += strlen(posix);
    
  •  *posix++ = ':';
    
  •  first = p + 1;
    
  •  *p = ';';
    
  • }
  • if (len < strlen(first))
  • fprintf(stderr, PATH length too long: %s\n, first);
  • else
  • cygwin32_conv_to_posix_path(first, posix);
  • return dst;
    -}
    -#endif

static char fbuf[MAXPATHLEN];

Index: ruby.c

ruby.c (revision 12804)
+++ ruby.c (working copy)
@@ -15,4 +15,5 @@
#ifdef CYGWIN
#include <windows.h>
+#include <sys/cygwin.h>
#endif
#ifdef _WIN32_WCE
@@ -117,103 +118,84 @@ extern VALUE rb_load_path;
#define STATIC_FILE_LENGTH 255

-#if defined _WIN32 || defined CYGWIN || defined DJGPP
-static char *
-rubylib_mangle(const char s, unsigned int l)
+#ifndef CharNext /
defined as CharNext[AW] on Windows. */
+#define CharNext ( + mblen(p, RUBY_MBCHAR_MAXSIZE))
+#endif
+
+#if defined(CYGWIN32)
+const char *
+conv_to_posix_path(char *win32, char *posix, int len)
{

  • static char *newp, *oldp;
  • static int newl, oldl, notfound;
  • static char newsub[STATIC_FILE_LENGTH + 1];
  • if (!newp && !notfound) {
  • newp = getenv(RUBYLIB_PREFIX);
  • if (newp) {
  •  char *s;
    
  •  oldp = newp;
    
  •  while (*newp && !ISSPACE(*newp) && *newp != ';') {
    
  • newp++;
  • oldl++; /* Skip digits. */
  •  }
    
  •  while (*newp && (ISSPACE(*newp) || *newp == ';')) {
    
  • newp++; /* Skip whitespace. */
  •  }
    
  •  newl = strlen(newp);
    
  •  if (newl == 0 || oldl == 0 || newl > STATIC_FILE_LENGTH) {
    
  • rb_fatal(malformed RUBYLIB_PREFIX);
  •  }
    
  •  strcpy(newsub, newp);
    
  •  s = newsub;
    
  •  while (*s) {
    
  • if (*s == \)
  •    *s = '/';
    
  • s++;
  •  }
    
  • }
  • else {
  •  notfound = 1;
    
  • char *first = win32;
  • char *p = win32;
  • char *dst = posix;
  • posix[0] = \0;
  • for (p = win32; *p; p++)
  • if (*p == ;) {
  •  *p = 0;
    
  •  cygwin32_conv_to_posix_path(first, posix);
    
  •  posix += strlen(posix);
    
  •  *posix++ = ':';
    
  •  first = p + 1;
    
  •  *p = ';';
    
    }
  • }
  • if (l == 0) {
  • l = strlen(s);
  • }
  • if (!newp || l < oldl || strncasecmp(oldp, s, oldl) != 0) {
  • static char ret[STATIC_FILE_LENGTH + 1];
  • strncpy(ret, s, l);
  • ret[l] = 0;
  • return ret;
  • }
  • if (l + newl - oldl > STATIC_FILE_LENGTH || newl >
    STATIC_FILE_LENGTH) {
  • rb_fatal(malformed RUBYLIB_PREFIX);
  • }
  • strcpy(newsub + newl, s + oldl);
  • newsub[l + newl - oldl] = 0;
  • return newsub;
  • if (len < strlen(first))
  • fprintf(stderr, PATH length too long: %s\n, first);
  • else
  • cygwin32_conv_to_posix_path(first, posix);
  • return dst;
    }

-#define rubylib_mangled_path(s, l) rb_str_new2(rubylib_mangle((s),
(l)))
-#define rubylib_mangled_path2(s) rb_str_new2(rubylib_mangle((s), 0))
-#else
-#define rubylib_mangled_path(s, l) rb_str_new((s), (l))
-#define rubylib_mangled_path2(s) rb_str_new2(s)
#endif

-void
-ruby_push_include(const char *path, VALUE (*filter) (VALUE))
+static void
+push_include(const char *path, VALUE (*filter) (VALUE))
{
const char sep = PATH_SEP_CHAR;

  • const char *p, *s;
  • if (path == 0)
  • return;
    -#if defined(CYGWIN)
  • {
  • char rubylib[FILENAME_MAX];
  • conv_to_posix_path(path, rubylib, FILENAME_MAX);
  • path = rubylib;
  • p = path;
  • while (*p) {
  • while (*p == sep)
  •  p++;
    
  • if (!*p) break;
  • for (s = p; *s && *s != sep; s = CharNext(s));
  • rb_ary_push(rb_load_path, (*filter)(rb_str_new(p, s - p)));
  • if (!*s) break;
  • p = s + 1;
    }
    -#endif
  • if (strchr(path, sep)) {
  • const char *p, *s;
  • VALUE ary = rb_ary_new();
  • p = path;
  • while (*p) {
  •  while (*p == sep)
    
  • p++;
  •  if ((s = strchr(p, sep)) != 0) {
    
  • rb_ary_push(ary,
  •      (*filter) (rubylib_mangled_path
    
  •           (p, (int)(s - p))));
    
  • p = s + 1;
  •  }
    
  •  else {
    
  • rb_ary_push(ary, (*filter) (rubylib_mangled_path2));
  • break;
  •  }
    

+}
+
+void
+ruby_push_include(const char *path, VALUE (*filter) (VALUE))
+{
+#if defined CYGWIN32

  • const char sep = ;;
  • const char *p, *s;
  • char rubylib[FILENAME_MAX], *buf;
  • int len;
  • p = path;
  • while (*p) {
  • while (*p == sep)
  •  p++;
    
  • if (!*p) break;
  • for (s = p; *s && *s != sep; s = CharNext(s));
  • if (*s) {
  •  buf = ALLOC_N(char, (len = s - p));
    
  •  MEMCPY(buf, p, char, len);
    
  •  cygwin32_conv_to_posix_path(buf, rubylib);
    
  •  free(buf);
    
  •  push_include(rubylib, filter);
    
  •  p = s + 1;
    
  • }
  • else {
  •  cygwin32_conv_to_posix_path(p, rubylib);
    
  •  push_include(rubylib, filter);
    
  •  break;
    
    }
  • rb_ary_concat(rb_load_path, ary);
  • }
  • else {
  • rb_ary_push(rb_load_path, (*filter) (rubylib_mangled_path2(path)));
    }
    +#else
  • push_include(path, filter);
    +#endif
    }

@@ -259,9 +241,5 @@ translate_char(char *p, int from, int to
if ((unsigned char)*p == from)
p = to;
-#ifdef CharNext /
defined as CharNext[AW] on Windows. */
p = CharNext;
-#else

  • p += mblen(p, RUBY_MBCHAR_MAXSIZE);
    -#endif
    }
    }
    @@ -301,6 +279,12 @@ ruby_init_loadpath(void)

    libpath[sizeof(libpath) - 1] = \0;
    -#if defined DOSISH || defined CYGWIN
    +#if defined DOSISH
    translate_char(libpath, \, /);
    +#elif defined CYGWIN

  • {

  • char rubylib[FILENAME_MAX];

  • cygwin_conv_to_posix_path(libpath, rubylib);

  • strncpy(libpath, rubylib, sizeof(libpath));

  • }
    #endif
    p = strrchr(libpath, /);
    @@ -323,4 +307,5 @@ ruby_init_loadpath(void)
    #define RUBY_RELATIVE(path) (path)
    #endif
    +#define incpush(path) rb_ary_push(rb_load_path, rb_str_new2(path))

    if (rb_safe_level() == 0) {
    @@ -329,22 +314,31 @@ ruby_init_loadpath(void)

#ifdef RUBY_SEARCH_PATH

  • ruby_incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH));
  • incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH));
    #endif
  • ruby_incpush(RUBY_RELATIVE(RUBY_SITE_LIB2));
  • incpush(RUBY_RELATIVE(RUBY_SITE_LIB2));
    #ifdef RUBY_SITE_THIN_ARCHLIB
  • ruby_incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
  • incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
    +#endif
  • incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
  • incpush(RUBY_RELATIVE(RUBY_SITE_LIB));

+#ifdef RUBY_VENDOR_LIB

  • incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
    +#ifdef RUBY_VENDOR_THIN_ARCHLIB
  • incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
    +#endif
  • incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
  • incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
    #endif
  • ruby_incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));

  • ruby_incpush(RUBY_RELATIVE(RUBY_SITE_LIB));

  • ruby_incpush(RUBY_RELATIVE(RUBY_LIB));

  • incpush(RUBY_RELATIVE(RUBY_LIB));
    #ifdef RUBY_THIN_ARCHLIB
  • ruby_incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
  • incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
    #endif
  • ruby_incpush(RUBY_RELATIVE(RUBY_ARCHLIB));
  • incpush(RUBY_RELATIVE(RUBY_ARCHLIB));

    if (rb_safe_level() == 0) {

  • ruby_incpush(".");
  • incpush(".");
    }
    }
    Index: missing/strftime.c
    ===================================================================
    missing/strftime.c (revision 12804)
    +++ missing/strftime.c (working copy)
    @@ -446,5 +446,5 @@ strftime(char *s, size_t maxsize, const
    tbuf[0] = +;
    }
  •  sprintf(tbuf+1, "%02d%02d", off/60, off%60);
    
  •  sprintf(tbuf+1, "%02d%02d", (int)off/60, (int)off%60);
     break;
    

#endif /* MAILHEADER_EXT */
Index: ext/socket/getnameinfo.c

ext/socket/getnameinfo.c (revision 12804)
+++ ext/socket/getnameinfo.c (working copy)
@@ -36,4 +36,5 @@

#include ruby/config.h
+#include <stdio.h>
#include <sys/types.h>
#ifndef _WIN32
@@ -52,7 +53,4 @@
#include <netdb.h>
#if defined(HAVE_RESOLV_H)
-#ifdef _SX
-#include <stdio.h>
-#endif
#include <resolv.h>
#endif
@@ -60,5 +58,4 @@
#ifdef _WIN32
#include <winsock2.h>
-#include <stdio.h>
#define snprintf _snprintf
#endif