mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	Suppress compiler warnings in readfuncs.c.
Commit 7357558fc8866e3a449aa9473c419b593d67b5b6 introduced "(void) token;" into the READ_TEMP_LOCALS() macro, to suppress complaints from gcc 4.6 when the value of token was not used anywhere in a particular node-read function. However, this just moved the warning around: inspection of buildfarm results shows that some compilers are now complaining that token is being read before it's set. Revert the READ_TEMP_LOCALS() macro change and instead put "(void) token;" into READ_NODE_FIELD(), which is the principal culprit for cases where the warning might occur. In principle we might need the same in READ_BITMAPSET_FIELD() and/or READ_LOCATION_FIELD(), but it seems unlikely that a node would consist only of such fields, so I'll leave them alone for now.
This commit is contained in:
		
							parent
							
								
									fa188b5ef5
								
							
						
					
					
						commit
						39bfc94c86
					
				| @ -48,8 +48,7 @@ | |||||||
| /* And a few guys need only the pg_strtok support fields */ | /* And a few guys need only the pg_strtok support fields */ | ||||||
| #define READ_TEMP_LOCALS()	\ | #define READ_TEMP_LOCALS()	\ | ||||||
| 	char	   *token;		\ | 	char	   *token;		\ | ||||||
| 	int			length;		\ | 	int			length | ||||||
| 	(void) token				/* possibly unused */ |  | ||||||
| 
 | 
 | ||||||
| /* ... but most need both */ | /* ... but most need both */ | ||||||
| #define READ_LOCALS(nodeTypeName)			\ | #define READ_LOCALS(nodeTypeName)			\ | ||||||
| @ -113,6 +112,7 @@ | |||||||
| /* Read a Node field */ | /* Read a Node field */ | ||||||
| #define READ_NODE_FIELD(fldname) \ | #define READ_NODE_FIELD(fldname) \ | ||||||
| 	token = pg_strtok(&length);		/* skip :fldname */ \ | 	token = pg_strtok(&length);		/* skip :fldname */ \ | ||||||
|  | 	(void) token;				/* in case not used elsewhere */ \ | ||||||
| 	local_node->fldname = nodeRead(NULL, 0) | 	local_node->fldname = nodeRead(NULL, 0) | ||||||
| 
 | 
 | ||||||
| /* Read a bitmapset field */ | /* Read a bitmapset field */ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user