# Trunk: generator.c:150: warning: unsigned int format, long i

**URL:** <https://www.ruby-forum.com/t/trunk-generator-c-warning-unsigned-int-format-long-i/109393>\
**Category:** Development\
**Created:** [July 14, 2007, 2:46am UTC](https://www.ruby-forum.com/t/trunk-generator-c-warning-unsigned-int-format-long-i/109393 "2007-07-14T02:46:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pegacorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/cdc98d/32.png) [@pegacorn](https://www.ruby-forum.com/u/pegacorn)\
**Post date:** [July 14, 2007, 2:46am UTC](https://www.ruby-forum.com/t/trunk-generator-c-warning-unsigned-int-format-long-i/109393/1 "2007-07-14T02:46:07Z")

</div>

ext/json e$B$G!"e(Brb\_raise  
e$B$X;XDj$7$F$$$k%U%)!\<%^%C%H$,%P%0$C$F$^$9!#e(B

gcc -I. -I…/…/…/…/.ext/include/i386-freebsd6.2  
-I…/…/…/…/./include -I…/…/…/…/./ext/json/ext/generator  
-DRUBY\_EXTCONF\_H=“extconf.h” -fPIC -g -O2 -Wall -c generator.c  
generator.c: In function `mHash_to_json': generator.c:150: warning: unsigned int format, long int arg (arg 3) generator.c: In function`mArray\_json\_transfrom’:  
generator.c:175: warning: unsigned int format, long int arg (arg 3)

# Index: ext/json/ext/generator/generator.c

— ext/json/ext/generator/generator.c (e$B%j%S%8%g%se(B 12779)  
+++ ext/json/ext/generator/generator.c (e$B:n6H%3%T!\<e(B)  
@@ -9,7 +9,7 @@  
#define check\_max\_nesting(state, depth) do {  
  
long current\_nesting = 1 + depth;  
  
if (state-\>max\_nesting != 0 && current\_nesting \>  
state-\>max\_nesting) \

- 

```
   rb_raise(eNestingError, "nesting of %u is too deep", 

```

current\_nesting); \

- 

```
   rb_raise(eNestingError, "nesting of %ld is too deep", 

```

current\_nesting);   
} while (0);

static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods,  
mObject,

---

<div class="post-metadata">

**Author:** ![pegacorn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/cdc98d/32.png) [@pegacorn](https://www.ruby-forum.com/u/pegacorn)\
**Post date:** [July 14, 2007, 4:15am UTC](https://www.ruby-forum.com/t/trunk-generator-c-warning-unsigned-int-format-long-i/109393/2 "2007-07-14T04:15:15Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31217] trunk: generator.c:150: warning:  
unsigned int format, long int arg (arg 3)”  
on Sat, 14 Jul 2007 09:44:54 +0900, pegacorn  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|ext/json e$B$G!"e(Brb\_raise e$B$X;XDj$7$F$$$k%U%)!\<%^%C%H$,%P%0$C$F$^$9!#e(B

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