# 1.0.2+ wont build

**URL:** <https://www.ruby-forum.com/t/1-0-2-wont-build/208897>\
**Category:** NGINX\
**Created:** [June 29, 2011, 10:43pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897 "2011-06-29T22:43:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 29, 2011, 10:43pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/1 "2011-06-29T22:43:11Z")

</div>

In auto/cc/gcc, you have:

CFLAGS="$CFLAGS -Werror"

and

CFLAGS="$CFLAGS -Wunused-variable"

so when building 1.0.2+ you receive this error:

gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
-Wunused-function -Wunused-variable -Wunused-value -Werror -g -O2 -I  
src/core -I src/event -I src/event/modules -I src/os/unix -I objs   
-o objs/src/event/ngx\_event\_openssl.o   
src/event/ngx\_event\_openssl.c  
src/event/ngx\_event\_openssl.c: In function ‘ngx\_ssl\_get\_cached\_session’:  
src/event/ngx\_event\_openssl.c:1690:31: error: variable ‘c’ set but not  
used [-Werror=unused-but-set-variable]  
cc1: all warnings being treated as errors

make[1]: \*\*\* [objs/src/event/ngx\_event\_openssl.o] Error 1

---

<div class="post-metadata">

**Author:** ![OQOQOQ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a587f6/32.png) [@OQOQOQ](https://www.ruby-forum.com/u/OQOQOQ)\
**Post date:** [June 30, 2011, 1:23pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/2 "2011-06-30T13:23:15Z")

</div>

On Thu, Jun 30, 2011 at 4:42 AM, OQ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In auto/cc/gcc, you have:
> 
> CFLAGS=“$CFLAGS -Werror”

Try 1.0.4?

Cheers,  
-agentzh

---

<div class="post-metadata">

**Author:** ![OQOQOQ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a587f6/32.png) [@OQOQOQ](https://www.ruby-forum.com/u/OQOQOQ)\
**Post date:** [June 30, 2011, 2:07pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/3 "2011-06-30T14:07:08Z")

</div>

Hello!

On Thu, Jun 30, 2011 at 07:22:43PM +0800, agentzh wrote:

> On Thu, Jun 30, 2011 at 4:42 AM, OQ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > In auto/cc/gcc, you have:
> > 
> > CFLAGS=“$CFLAGS -Werror”
> 
> Try 1.0.4?

Won’t help.

Maxim D.

---

<div class="post-metadata">

**Author:** ![OQOQOQ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a587f6/32.png) [@OQOQOQ](https://www.ruby-forum.com/u/OQOQOQ)\
**Post date:** [June 30, 2011, 2:08pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/4 "2011-06-30T14:08:59Z")

</div>

Hello!

On Thu, Jun 30, 2011 at 04:06:37PM +0400, Maxim D. wrote:

[…]

> Yes, thank you for report (though it’s about gcc 4.6+, not about  
> nginx 1.0.2+). Try the attached patch.

Oops, forgot to actually attach patch. Let me try again.

Maxim D.

---

<div class="post-metadata">

**Author:** ![OQOQOQ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a587f6/32.png) [@OQOQOQ](https://www.ruby-forum.com/u/OQOQOQ)\
**Post date:** [June 30, 2011, 2:07pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/5 "2011-06-30T14:07:08Z")

</div>

Hello!

On Wed, Jun 29, 2011 at 03:42:26PM -0500, OQ wrote:

> gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> -Wunused-function -Wunused-variable -Wunused-value -Werror -g -O2 -I  
> src/core -I src/event -I src/event/modules -I src/os/unix -I objs   
> -o objs/src/event/ngx\_event\_openssl.o   
> src/event/ngx\_event\_openssl.c  
> src/event/ngx\_event\_openssl.c: In function ‘ngx\_ssl\_get\_cached\_session’:  
> src/event/ngx\_event\_openssl.c:1690:31: error: variable ‘c’ set but not  
> used [-Werror=unused-but-set-variable]  
> cc1: all warnings being treated as errors
> 
> make[1]: \*\*\* [objs/src/event/ngx\_event\_openssl.o] Error 1

Yes, thank you for report (though it’s about gcc 4.6+, not about  
nginx 1.0.2+). Try the attached patch.

Obvious workaround is to use

./configure --with-cc-opt=“-Wno-unused-but-set-variable”

Maxim D.

---

<div class="post-metadata">

**Author:** ![OQOQOQ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a587f6/32.png) [@OQOQOQ](https://www.ruby-forum.com/u/OQOQOQ)\
**Post date:** [June 30, 2011, 6:04pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/6 "2011-06-30T18:04:01Z")

</div>

Hello!

On Thu, Jun 30, 2011 at 09:43:18AM -0500, OQ wrote:

> Just throwing that data point out there.  
> 1.0.1 will fail with gcc 4.6 as well, when built without  
> –with-debug option and with ssl.

Maxim D.

---

<div class="post-metadata">

**Author:** ![OQOQOQ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a587f6/32.png) [@OQOQOQ](https://www.ruby-forum.com/u/OQOQOQ)\
**Post date:** [June 30, 2011, 4:44pm UTC](https://www.ruby-forum.com/t/1-0-2-wont-build/208897/7 "2011-06-30T16:44:11Z")

</div>

On Thu, Jun 30, 2011 at 7:06 AM, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hello!  
> Yes, thank you for report (though it’s about gcc 4.6+, not about  
> nginx 1.0.2+). Try the attached patch.

Yea I realized that after I sent it, but forgot to send the followup.  
I’m currently running 1.0.1 built with gcc 4.6.0 and it builds fine,  
but 1.0.1 also fails to build in 4.6.1.

Just throwing that data point out there.
