mirror of
				https://gitlab.com/qemu-project/openbios.git
				synced 2024-02-13 08:34:06 +08:00 
			
		
		
		
	libc: Fix build on recent gcc
This fixes this warning (which escalates as an error):
roms/openbios/libc/string.c: In function ‘strdup’:
roms/openbios/libc/string.c:353:4: error: nonnull argument ‘str’ compared to NULL [-Werror=nonnull-compare]
  if( !str )
    ^
cc1: all warnings being treated as errors
rules.mak:122: recipe for target 'target/libc		printf("stdout is %s\n", stdout->name);
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
			
			
This commit is contained in:
		 Benjamin Herrenschmidt
					Benjamin Herrenschmidt
				
			
				
					committed by
					
						 Mark Cave-Ayland
						Mark Cave-Ayland
					
				
			
			
				
	
			
			
			 Mark Cave-Ayland
						Mark Cave-Ayland
					
				
			
						parent
						
							d0473cefc5
						
					
				
				
					commit
					14be7d187a
				
			| @ -349,10 +349,7 @@ int memcmp(const void * cs,const void * ct,size_t count) | ||||
| char * | ||||
| strdup( const char *str ) | ||||
| { | ||||
| 	char *p; | ||||
| 	if( !str ) | ||||
| 		return NULL; | ||||
| 	p = malloc( strlen(str) + 1 ); | ||||
| 	char *p = malloc( strlen(str) + 1 ); | ||||
| 	strcpy( p, str ); | ||||
| 	return p; | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user