On Wed, 08 Sep 2010 09:40:05 +0300, Leonid Borisenko
<[email protected]> wrote:
> Hello,
> 
> On 08.09.2010 00:59, Daniel Geržo wrote:
>> Hi,
>>
>> I am trying to build latest 0.9.6 release on FreeBSD but I am getting
>> the following warning/error:
>>
>> cc -c -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -pipe
>> -march=nocona -fno-strict-aliasing -I/usr/local/include/python2.6
>> -I/usr/local/include/python2.6 -DUWSGI_EMBEDDED -DUWSGI_UDP
>> -DUWSGI_ASYNC -DUWSGI_MULTICAST -DUWSGI_MINTERPRETERS -DUWSGI_NAGIOS
>> -DUWSGI_INI -DUWSGI_PROXY -DUWSGI_HTTP -DUWSGI_SNMP -DUWSGI_THREADING
>> -DUWSGI_PASTE -DUWSGI_SENDFILE -I/usr/local/include/libxml2
>> -I/usr/local/include -cc1: warnings being treated as errors
>> http.c: In function 'http_request':
>> http.c:185: warning: 'uwsgi_fd' may be used uninitialized in this function
>> DUWSGI_XML -DUWSGI_XML_LIBXML2 -DUWSGI_PLUGIN_DIR=\".\" -DUWSGI_SPOOLER
>> -o http.o http.c
>> *** Error code 1
>> 1 error
>> *** Error code 1
> 
>   I've met the same error(s) at comiling uWSGI 0.9.6. It's generated
> by including '-O2' option in CFLAGS. Patches are attached.

This seems to be correct. I was able to compile 0.9.6 with -O0
successfully.
Applying your patches, I am still unable to compile it, however I am
getting a different warning now:

cc -c -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-pipe -march=nocona -fno-strict-aliasing -I/usr/local/include/python2.6
-I/usr/local/include/python2.6 -DUWSGI_EMBEDDED -DUWSGI_UDP
-DUWSGI_ASYNC -DUWSGI_MULTICAST -DUWSGI_MINTERPRETERS -DUWSGI_NAGIOS
-DUWSGI_INI -DUWSGI_PROXY -DUWSGI_HTTP -DUWSGI_SNMP -DUWSGI_THREADING
-DUWSGI_PASTE -DUWSGI_SENDFILE -I/usr/local/include/libxml2
-I/usr/local/include -DUWSGI_XML -DUWSGI_XML_LIBXMLcc1: warnings being
treated as errors
plugins.c: In function 'embed_plugins':
plugins.c:4: warning: unused variable 'ret'
2 -DUWSGI_PLUGIN_DIR=\".\" -DUWSGI_SPOOLER -o uwsgi_handlers.o
uwsgi_handlers.c
cc -c -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-pipe -march=nocona -fno-strict-aliasing -I/usr/local/include/python2.6
-I/usr/local/include/python2.6 -DUWSGI_EMBEDDED -DUWSGI_UDP
-DUWSGI_ASYNC -DUWSGI_MULTICAST -DUWSGI_MINTERPRETERS -DUWSGI_NAGIOS
-DUWSGI_INI -DUWSGI_PROXY -DUWSGI_HTTP -DUWSGI_SNMP -DUWSGI_THREADING
-DUWSGI_PASTE -DUWSGI_SENDFILE -I/usr/local/include/libxml2
-I/usr/local/include -DUWSGI_XML -DUWSGI_XML_LIBXML2
-DUWSGI_PLUGIN_DIR=\".\" -DUWSGI_SPOOLER -o plugins.o plugins.c
*** Error code 1
1 error
*** Error code 1

The complete diff against 0.9.6 is attached.
Additionally to your changes, I made embed_plugins() to return int,
which makes sense to me...

-- 
S pozdravom / Best regards
  Daniel
--- ./http.c.orig	2010-08-29 06:51:52.000000000 +0200
+++ ./http.c	2010-09-10 16:34:23.990426501 +0200
@@ -182,7 +182,7 @@
 	struct uwsgi_http_req *ur = (struct uwsgi_http_req *) u_h_r ;
 
 	int clientfd = ur->fd;
-	int uwsgi_fd;
+	int uwsgi_fd = 0;
 
 	int need_to_read = 1;
 	int state = uwsgi_http_method;
--- ./plugins.c.orig	2010-08-29 06:51:52.000000000 +0200
+++ ./plugins.c	2010-09-10 16:33:35.471808130 +0200
@@ -1,6 +1,7 @@
 #include "uwsgi.h"
 
-void embed_plugins(struct uwsgi_server *uwsgi) {
+int embed_plugins(struct uwsgi_server *uwsgi) {
+	int ret = 0;
 
 #ifdef UWSGI_EMBED_PLUGIN_PSGI
 	if (uwsgi->plugin_arg_psgi)
@@ -17,6 +18,7 @@
 		ret = uwsgi_load_plugin(uwsgi, 7, "rack_plugin.so", uwsgi->plugin_arg_rack, 0);
 #endif
 
+	return ret;
 }
 
 int uwsgi_load_plugin(struct uwsgi_server *uwsgi, int modifier, char *plugin, char *pargs, int absolute) {
--- ./routing.c.orig	2010-08-29 06:51:52.000000000 +0200
+++ ./routing.c	2010-09-10 16:34:10.586680517 +0200
@@ -63,7 +63,7 @@
 void uwsgi_route_action_wsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req, struct uwsgi_route *ur) {
 
 	int i;
-	PyObject *route_py_callbase, *route_py_dict;
+	PyObject *route_py_callbase = NULL, *route_py_dict = NULL;
 
 	uwsgi_log("managing WSGI route...\n");
         if (ur->callable == NULL) {
@@ -106,7 +106,7 @@
 
 void uwsgi_route_action_uwsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req, struct uwsgi_route *ur) {
 
-	PyObject *route_py_callbase, *route_py_dict;
+	PyObject *route_py_callbase = NULL, *route_py_dict = NULL;
 	int i;
 
 	uwsgi_log("managing uwsgi route...\n");
--- ./uwsgi.h.orig	2010-09-10 16:34:33.959880773 +0200
+++ ./uwsgi.h	2010-09-10 16:34:41.542504418 +0200
@@ -1018,7 +1018,7 @@
 #endif
 
 int uwsgi_load_plugin(struct uwsgi_server *, int, char *, char *, int);
-void embed_plugins(struct uwsgi_server *);
+int embed_plugins(struct uwsgi_server *);
 
 
 // PLUGINS
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to