stddef.h: fix zeroptr's definition
As Aaron pointed out, the old definition made the compiler emit two memory accesses, to 0 (for derefencing) and then reading at whatever address could be read from there. Change-Id: I5cdd53f5bd2d2397c43f09f3e5fa46be08744b01 Found-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/14342 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
		
				
					committed by
					
						 Martin Roth
						Martin Roth
					
				
			
			
				
	
			
			
			
						parent
						
							b3ee03c404
						
					
				
				
					commit
					c42b786485
				
			| @@ -39,7 +39,7 @@ typedef unsigned int wint_t; | ||||
|  * undefined behaviour and do whatever" trickery in compilers. | ||||
|  * Use when you _really_ need to read32(zeroptr) (ie. read address 0). | ||||
|  */ | ||||
| extern void *zeroptr; | ||||
| extern char zeroptr[]; | ||||
| #endif | ||||
|  | ||||
| #endif /* STDDEF_H */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user