Обсуждение: new compile warning
Just cvsup'd and built from make clean. Getting this new warning: make[3]: Entering directory `/opt/src/pgsql/src/pl/plpython' i386-redhat-linux-gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -I. -I/usr/include/python2.2 -I../../../src/include -I/usr/kerberos/include -c -o plpython.o plpython.c -MMD plpython.c: In function `plpython_call_handler': plpython.c:354: warning: suggest explicit braces to avoid ambiguous `else' Joe
Joe Conway <mail@joeconway.com> writes:
> plpython.c: In function `plpython_call_handler':
> plpython.c:354: warning: suggest explicit braces to avoid ambiguous `else'
Apparently the Python boys are not familiar with the do {...} while (0)
trick to ensure that a macro containing C statements won't interact with
its environment. I'll put back the braces that pgindent removed, but
someone should file a bug report against Py_DECREF().
regards, tom lane
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> > plpython.c: In function `plpython_call_handler':
> > plpython.c:354: warning: suggest explicit braces to avoid ambiguous `else'
>
> Apparently the Python boys are not familiar with the do {...} while (0)
> trick to ensure that a macro containing C statements won't interact with
> its environment. I'll put back the braces that pgindent removed, but
> someone should file a bug report against Py_DECREF().
>
Good fix. That comment will prevent pgindent from modifying it in the
future.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square,
Pennsylvania19073