Commit 1a0ebe61 authored by Bruce Momjian's avatar Bruce Momjian

Add comment about why "((void) 0)" is used in copy macros.

parent 44ead233
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.309 2009/05/29 13:54:52 meskes Exp $ * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.310 2009/06/03 14:48:33 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -175,7 +175,8 @@ typedef struct ...@@ -175,7 +175,8 @@ typedef struct
/* /*
* These macros centralize code used to process line_buf and raw_buf buffers. * These macros centralize code used to process line_buf and raw_buf buffers.
* They are macros because they often do continue/break control and to avoid * They are macros because they often do continue/break control and to avoid
* function call overhead in tight COPY loops. * function call overhead in tight COPY loops. "((void) 0)" is used to silence
* compiler warnings.
* *
* We must use "if (1)" because "do {} while(0)" overrides the continue/break * We must use "if (1)" because "do {} while(0)" overrides the continue/break
* processing. See http://www.cit.gu.edu.au/~anthony/info/C/C.macros. * processing. See http://www.cit.gu.edu.au/~anthony/info/C/C.macros.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment