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.
Description: Add forgotten initialization of variable 'ret'.
Author: Leonid Borisenko <[email protected]>
Index: uwsgi-0.9.6/plugins.c
===================================================================
--- uwsgi-0.9.6.orig/plugins.c 2010-08-31 21:26:07.000000000 +0300
+++ uwsgi-0.9.6/plugins.c 2010-08-31 21:27:00.000000000 +0300
@@ -1,6 +1,7 @@
#include "uwsgi.h"
void embed_plugins(struct uwsgi_server *uwsgi) {
+ int ret = 0;
#ifdef UWSGI_EMBED_PLUGIN_PSGI
if (uwsgi->plugin_arg_psgi)
Description: Initialize variable 'route_py_dict'
gcc (v4.4.5 20100816) emits warning about it when CFLAGS+="-O2".
.
For assurance, variable 'route_py_callbase' is also initialized.
Author: Leonid Borisenko <[email protected]>
Index: uwsgi-0.9.6/routing.c
===================================================================
--- uwsgi-0.9.6.orig/routing.c 2010-08-30 02:43:48.000000000 +0300
+++ uwsgi-0.9.6/routing.c 2010-08-30 02:44:19.000000000 +0300
@@ -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");
Description: initialize variable 'uwsgi_fd'
gcc (v4.4.5 20100816) emits warning about it when CFLAGS+="-O2"
Author: Leonid Borisenko <[email protected]>
Index: uwsgi-0.9.6/http.c
===================================================================
--- uwsgi-0.9.6.orig/http.c 2010-08-29 11:17:38.000000000 +0300
+++ uwsgi-0.9.6/http.c 2010-08-29 11:17:48.000000000 +0300
@@ -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;
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi