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/041215.html below:

[Python-Dev] Py_DECREF causes spurious gcc warning

[Python-Dev] Py_DECREF causes spurious gcc warningMartin v. Löwis martin at v.loewis.de
Thu Dec 18 16:27:30 EST 2003
Skip Montanaro <skip at pobox.com> writes:

> I meant the Py_*REF macros which expand to "if" statements and you'd bracify
> the clauses, e.g., Py_DECREF would become:

That would still trigger the warning about

  if(1) Py_DECREF(foo);

as this expands to

  if(1) if(cond(foo)) {action1(foo);} else {action2(foo);}

This, in turn, is potentially unintended, as the author of that code
may have meant the else to go with the if(1), whereas, in C, it goes
with the if(cond(foo)). As Tim explains, the intended semantics is the
desired one, too, so there is really no problem in the code. As Tim
also explains, do{}while(1) would silence the warning.

Regards,
Martin

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