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

[Python-Dev] Py_DECREF causes spurious gcc warning

[Python-Dev] Py_DECREF causes spurious gcc warning [Python-Dev] Py_DECREF causes spurious gcc warningMartin v. Löwis martin at v.loewis.de
Sat Dec 20 05:31:18 EST 2003
"Zack Weinberg" <zack at codesourcery.com> writes:

> It does, however, lead to a different problem:
> 
>   if (condition)
>     Py_DECREF (foo);
>   else               // oops, syntax error here

How so? This expands to

if(condition)
  if(cond2)action1;
  else action2;
else
  ...

This is perfectly well-formed C, and it groups as my
indentation suggests.

There is no real problem with this macro. It is just gcc complaining
falsely.

> In general I consider it appropriate to wrap _all_ macros that don't
> return a value in do { ... } while (0), because that way you don't
> have to worry about which of them truly need it.

Hmm. Yes, this could be done - but it is unfortunate that this needs
to be done only to silence gcc.

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