mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	[PATCH] kbuild: add -Wundef to global CFLAGS
A recent change to the aic scsi driver removed two defines to detect endianness. cpp handles undefined strings as 0. As a result, the test turned into #if 0 == 0 and the wrong code was selected. Adding -Wundef to global CFLAGS will catch such errors. Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
		
							parent
							
								
									ce454d4d72
								
							
						
					
					
						commit
						3c521e06fa
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		
							
								
								
									
										4
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
										
									
									
									
								
							|  | @ -203,7 +203,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ | ||||||
| 
 | 
 | ||||||
| HOSTCC  	= gcc | HOSTCC  	= gcc | ||||||
| HOSTCXX  	= g++ | HOSTCXX  	= g++ | ||||||
| HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer | HOSTCFLAGS	= -Wall -Wundef -Wstrict-prototypes -O2 -fomit-frame-pointer | ||||||
| HOSTCXXFLAGS	= -O2 | HOSTCXXFLAGS	= -O2 | ||||||
| 
 | 
 | ||||||
| # 	Decide whether to build built-in, modular, or both.
 | # 	Decide whether to build built-in, modular, or both.
 | ||||||
|  | @ -348,7 +348,7 @@ LINUXINCLUDE    := -Iinclude \ | ||||||
| 
 | 
 | ||||||
| CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE) | CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE) | ||||||
| 
 | 
 | ||||||
| CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs \
 | CFLAGS 		:= -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 | ||||||
| 	  	   -fno-strict-aliasing -fno-common \
 | 	  	   -fno-strict-aliasing -fno-common \
 | ||||||
| 		   -ffreestanding | 		   -ffreestanding | ||||||
| AFLAGS		:= -D__ASSEMBLY__ | AFLAGS		:= -D__ASSEMBLY__ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Olaf Hering
						Olaf Hering