A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/041134.html below:

[Python-Dev] Py_DECREF causes spurious gcc warning

[Python-Dev] Py_DECREF causes spurious gcc warningEdward C. Jones edcjones at erols.com
Wed Dec 17 17:41:20 EST 2003
I use Gentoo 1.4 Linux with gcc 3.2.2. The C program given below gives 
the following compiler message:

silly.c: In function `silly':
silly.c:5: warning: suggest explicit braces to avoid ambiguous `else'

I doubt if there is any bug in Py_DECREF. But would it be possible to 
jiggle the Py_DECREF macros to suppress this message? In my real code, 
I, of course, just added braces.

-----------------------
#include </usr/local/include/python2.3/Python.h>

static PyObject* silly(PyObject* obj, PyObject *args)
{
     if (1)
         Py_DECREF(Py_None);
     return NULL;
}

static PyMethodDef silly_Methods[] = {
     {"silly", silly, METH_VARARGS, ""},
     {NULL, NULL, 0, NULL}   /* sentinel */
};

void initsilly(void)
{
     (void) Py_InitModule("silly", silly_Methods);
}
-----------------------


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4