Fix autoconf check for function attributes.
GCC warns when a function attribute has no effect. The autoconf check turns warnings about attributes into errors, therefore thinking that they did not work. The reason was that the test function returned void, which is not suitable for checking both __malloc__ and __warn_unused_result__.
This commit is contained in:
		
							parent
							
								
									84ecc972e5
								
							
						
					
					
						commit
						ab0576a203
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -9,8 +9,8 @@ AC_DEFUN([tinc_ATTRIBUTE],
 | 
			
		|||
    CFLAGS="$CFLAGS -Wall -Werror"
 | 
			
		||||
    AC_COMPILE_IFELSE(
 | 
			
		||||
      [AC_LANG_SOURCE(
 | 
			
		||||
        [void test(void) __attribute__ (($1));
 | 
			
		||||
	 void test(void) { return; }
 | 
			
		||||
        [void *test(void) __attribute__ (($1));
 | 
			
		||||
	 void *test(void) { return (void *)0; }
 | 
			
		||||
	],
 | 
			
		||||
       )],
 | 
			
		||||
       [tinc_cv_attribute_$1=yes],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue