# \[Bug #2118\] SUN $B$N(B cc (SunStudio11 C 5.8 $B%3%s%Q%$%i(B) $B$G(B dir.c $B$N%3%s%Q%$%k$K\<:

**URL:** <https://www.ruby-forum.com/t/bug-2118-sun-b-n-b-cc-sunstudio11-c-5-8-b-3-s-q-i-b-b-g-b-dir-c-b-n-3-s-q-k-k/175726>\
**Category:** Development\
**Created:** [September 18, 2009, 1:50pm UTC](https://www.ruby-forum.com/t/bug-2118-sun-b-n-b-cc-sunstudio11-c-5-8-b-3-s-q-i-b-b-g-b-dir-c-b-n-3-s-q-k-k/175726 "2009-09-18T13:50:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naohisa\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f4b2a3/32.png) [@Naohisa\_G](https://www.ruby-forum.com/u/Naohisa_G)\
**Post date:** [September 18, 2009, 1:50pm UTC](https://www.ruby-forum.com/t/bug-2118-sun-b-n-b-cc-sunstudio11-c-5-8-b-3-s-q-i-b-b-g-b-dir-c-b-n-3-s-q-k-k/175726/1 "2009-09-18T13:50:15Z")

</div>

Bug #2118: SUN e$B$Ne(B cc (SunStudio11 C 5.8 e$B%3%s%Q%$%ie(B) e$B$Ge(B  
dir.c e$B$N%3%s%Q%$%k$K\<:GT$9$ke(B  
[http://redmine.ruby-lang.org/issues/show/2118](http://redmine.ruby-lang.org/issues/show/2118)

e$B5/I\<\<Te(B: Naohisa G.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
ruby -v: ruby 1.9.2dev (2009-09-18) [sparc-solaris2.10]

Solaris10 e$B\>e$Ne(B Sun Studio 11 C 5.8 e$B%3%s%Q%$%i$K$Fe(B trunk  
r25000 e$B$Ne(B  
e$B%3%s%Q%$%k$K\<:GT$7$^$9!#e(B

$ ./configure --prefix=/XXXXX/testruby/sparc/trunk-25000\_64cc   
MAKE=/usr/local/64/bin/make   
CC=/opt/SUNWspro/bin/cc   
CXX=/opt/SUNWspro/bin/CC   
CFLAGS=“-xarch=v9 -xtarget=native64 -I/usr/local/64/include”   
LDSHARED=“/opt/SUNWspro/bin/cc -G”   
LDFLAGS=“-xarch=v9 -xtarget=native64 -L/usr/local/64/lib  
-R/usr/local/64/lib”

$ /usr/local/64/bin/make  
(e$BCfN,e(B)  
/opt/SUNWspro/bin/cc -xarch=v9 -xtarget=native64 -I/usr/local/64/include  
-I. -I.ext/include/sparc-solaris2.10 -I./include -I. -DRUBY\_EXPORT -o  
dir.o -c dir.c  
“./include/ruby/ruby.h”, line 958: warning: implicit function  
declaration: rb\_type  
“dir.c”, line 394: operands have incompatible types:  
void “:” unsigned long  
“dir.c”, line 394: operands have incompatible types:  
volatile unsigned long “:” void  
“dir.c”, line 1632: operands have incompatible types:  
void “:” unsigned long  
“dir.c”, line 1632: operands have incompatible types:  
volatile unsigned long “:” void  
“dir.c”, line 1662: operands have incompatible types:  
void “:” unsigned long  
“dir.c”, line 1662: operands have incompatible types:  
volatile unsigned long “:” void  
cc: acomp failed for dir.c  
make: \*\*\* [dir.o] Error 2

Warninge$B$O$$$C$?$s$OL5;k$7$F!"%(%i!\<$KCeL$9$k$H!"e(B

“dir.c”, line 394: operands have incompatible types:  
void “:” unsigned long  
e$B$,H/@8$7$F$$$k9T$NFbMF$O!"e(B  
GlobPathValue(dirname, FALSE);  
e$B$G$9!#$3$l$O%^%/%m$G!"e(B  
#define GlobPathValue(str, safe)   
/\* can contain null bytes as separators \*/   
(!RB\_TYPE\_P(str, T\_STRING) ?   
FilePathValue(str) :   
(safe) ? rb\_check\_safe\_obj(str) : (str))  
e$B$N$h$&$Ke(B3e$B9`1i;;;R$r;HMQ$7$F$$$F!"e(B e$B$3$NCf$Ge(B rb_check_safe_obj(str) e$B$,e(B void e$B$rJV$94X?t$N$?$a!"e(B 3e$B9`1i;;;RFb$G7?$K8\_49@-$,$J$$$H$$$&%(%i!\<$r=P$7$F$$$k$h$&$G$9!#e(B

# e$B0J2\<$N$h$&$K!Ve(B,e$B!W$r;H$C$FCMe(B 0 e$B$rJV$9$h$&$K$7$?$i%3%s%Q%$%k$ODL$j$^$7$?!#e(B rb\_check\_safe\_obj(str) e$B$r0O$`e(B()e$B$OITMW$+$b$7$l$^$;$s$,G0$N$?$aF~$l$^$7$?!#e(B

— dir.c (revision 25000)  
+++ dir.c (working copy)  
@@ -343,7 +343,7 @@  
/\* can contain null bytes as separators \*/   
(!RB\_TYPE\_P(str, T\_STRING) ?   
FilePathValue(str) : \

- 

```
(safe) ? rb_check_safe_obj(str) : (str))

```

- 

```
(safe) ? ((rb_check_safe_obj(str)),0) : (str))

```

# static VALUE dir\_s\_alloc(VALUE klass)

# “./include/ruby/ruby.h”, line 958: warning: implicit function declaration: rb\_type e$B$O:#$N$H$3$me(B gcc e$B0J30$N\>l9g$K$N$\_=P$ke(B warning e$B$N$h$&$G!"e(B rb\_type e$B$N%W%m%H%?%$%W@k8@$re(B TYPE() e$B$,;H$o$l$kA0$KF~$l$l$P\>C$($^$7$?!#e(B

— include/ruby/ruby.h (revision 25000)  
+++ include/ruby/ruby.h (working copy)  
@@ -952,6 +952,7 @@  
#ifdef **GNUC**

# define NUM2CHR(x) ({VALUE num2chr\_x = (x);

# NUM2CHR\_internal(num2chr\_x);}) #else +static inline int rb\_type(VALUE); static inline char NUM2CHR(VALUE x) {
