1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| $ make gcc -Wall -O -fstrength-reduce -fomit-frame-pointer \ -nostdinc -Iinclude -c -o init/main.o init/main.c In file included from include/sys/time.h:56, from include/unistd.h:54, from init/main.c:8: include/time.h:46:8: warning: conflicting types for built-in function ‘strftime’; expected ‘long unsigned int(char *, long unsigned int, const char *, const void *)’ [-Wbuiltin-declaration-mismatch] 46 | size_t strftime(char * s, size_t smax, const char * fmt, const struct tm * tp); | ^~~~~~~~ include/time.h:1:1: note: ‘strftime’ is declared in header ‘<time.h>’ +++ |+#include <time.h> 1 | In file included from init/main.c:8: init/main.c:23:29: error: static declaration of ‘fork’ follows non-static declaration 23 | static inline _syscall0(int,fork) | ^~~~ include/unistd.h:151:6: note: in definition of macro ‘_syscall0’ 151 | type name(void) \ | ^~~~ include/unistd.h:227:5: note: previous declaration of ‘fork’ with type ‘int(void)’ 227 | int fork(void); | ^~~~ init/main.c:24:29: error: static declaration of ‘pause’ follows non-static declaration 24 | static inline _syscall0(int,pause) | ^~~~~ include/unistd.h:151:6: note: in definition of macro ‘_syscall0’ 151 | type name(void) \ | ^~~~ include/unistd.h:241:5: note: previous declaration of ‘pause’ with type ‘int(void)’ 241 | int pause(void); | ^~~~~ init/main.c:26:29: error: static declaration of ‘sync’ follows non-static declaration 26 | static inline _syscall0(int,sync) | ^~~~ include/unistd.h:151:6: note: in definition of macro ‘_syscall0’ 151 | type name(void) \ | ^~~~ include/unistd.h:252:5: note: previous declaration of ‘sync’ with type ‘int(void)’ 252 | int sync(void); | ^~~~ In file included from include/linux/mm.h:6, from include/linux/sched.h:36, from init/main.c:29: include/linux/kernel.h:11:8: warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch] 11 | void * malloc(unsigned int size); | ^~~~~~ include/linux/kernel.h:1:1: note: ‘malloc’ is declared in header ‘<stdlib.h>’ +++ |+#include <stdlib.h> 1 | /* In file included from init/main.c:42: include/string.h:38:22: warning: conflicting types for built-in function ‘strncpy’; expected ‘char *(char *, const char *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 38 | extern inline char * strncpy(char * dest,const char *src,int count) | ^~~~~~~ include/string.h:1:1: note: ‘strncpy’ is declared in header ‘<string.h>’ +++ |+#include <string.h> 1 | include/string.h:68:22: warning: conflicting types for built-in function ‘strncat’; expected ‘char *(char *, const char *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 68 | extern inline char * strncat(char * dest,const char * src,int count) | ^~~~~~~ include/string.h:68:22: note: ‘strncat’ is declared in header ‘<string.h>’ include/string.h:107:19: warning: conflicting types for built-in function ‘strncmp’; expected ‘int(const char *, const char *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 107 | extern inline int strncmp(const char * cs,const char * ct,int count) | ^~~~~~~ include/string.h:107:19: note: ‘strncmp’ is declared in header ‘<string.h>’ include/string.h:128:22: warning: conflicting types for built-in function ‘strchr’; expected ‘char *(const char *, int)’ [-Wbuiltin-declaration-mismatch] 128 | extern inline char * strchr(const char * s,char c) | ^~~~~~ include/string.h:128:22: note: ‘strchr’ is declared in header ‘<string.h>’ include/string.h:145:22: warning: conflicting types for built-in function ‘strrchr’; expected ‘char *(const char *, int)’ [-Wbuiltin-declaration-mismatch] 145 | extern inline char * strrchr(const char * s,char c) | ^~~~~~~ include/string.h:145:22: note: ‘strrchr’ is declared in header ‘<string.h>’ include/string.h:161:19: warning: conflicting types for built-in function ‘strspn’; expected ‘long unsigned int(const char *, const char *)’ [-Wbuiltin-declaration-mismatch] 161 | extern inline int strspn(const char * cs, const char * ct) | ^~~~~~ include/string.h:161:19: note: ‘strspn’ is declared in header ‘<string.h>’ include/string.h:185:19: warning: conflicting types for built-in function ‘strcspn’; expected ‘long unsigned int(const char *, const char *)’ [-Wbuiltin-declaration-mismatch] 185 | extern inline int strcspn(const char * cs, const char * ct) | ^~~~~~~ include/string.h:185:19: note: ‘strcspn’ is declared in header ‘<string.h>’ include/string.h:263:19: warning: conflicting types for built-in function ‘strlen’; expected ‘long unsigned int(const char *)’ [-Wbuiltin-declaration-mismatch] 263 | extern inline int strlen(const char * s) | ^~~~~~ include/string.h:263:19: note: ‘strlen’ is declared in header ‘<string.h>’ include/string.h:336:22: warning: conflicting types for built-in function ‘memcpy’; expected ‘void *(void *, const void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 336 | extern inline void * memcpy(void * dest,const void * src, int n) | ^~~~~~ include/string.h:336:22: note: ‘memcpy’ is declared in header ‘<string.h>’ include/string.h:346:22: warning: conflicting types for built-in function ‘memmove’; expected ‘void *(void *, const void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 346 | extern inline void * memmove(void * dest,const void * src, int n) | ^~~~~~~ include/string.h:346:22: note: ‘memmove’ is declared in header ‘<string.h>’ include/string.h:363:19: warning: conflicting types for built-in function ‘memcmp’; expected ‘int(const void *, const void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 363 | extern inline int memcmp(const void * cs,const void * ct,int count) | ^~~~~~ include/string.h:363:19: note: ‘memcmp’ is declared in header ‘<string.h>’ include/string.h:379:22: warning: conflicting types for built-in function ‘memchr’; expected ‘void *(const void *, int, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 379 | extern inline void * memchr(const void * cs,char c,int count) | ^~~~~~ include/string.h:379:22: note: ‘memchr’ is declared in header ‘<string.h>’ include/string.h:395:22: warning: conflicting types for built-in function ‘memset’; expected ‘void *(void *, int, long unsigned int)’ [-Wbuiltin-declaration-mismatch] 395 | extern inline void * memset(void * s,char c,int count) | ^~~~~~ include/string.h:395:22: note: ‘memset’ is declared in header ‘<string.h>’ init/main.c:47:1: warning: ‘format’ attribute cannot be applied to a function that does not take variable arguments [-Wattributes] 47 | extern int vsprintf(); | ^~~~~~ init/main.c: In function ‘sprintf’: init/main.c:63:32: warning: passing argument 3 of ‘vsprintf’ from incompatible pointer type [-Wincompatible-pointer-types] 63 | i = vsprintf(str, fmt, args); | ^~~~ | | | va_list {aka char *} init/main.c:47:12: note: expected ‘__va_list_tag *’ but argument is of type ‘va_list’ {aka ‘char *’} 47 | extern int vsprintf(); | ^~~~~~~~ init/main.c: At top level: init/main.c:127:6: warning: return type of ‘main’ is not ‘int’ [-Wmain] 127 | void main(void) /* This really IS void, no error here. */ | ^~~~ init/main.c:179:12: error: static declaration of ‘printf’ follows non-static declaration 179 | static int printf(const char *fmt, ...) | ^~~~~~ In file included from include/linux/mm.h:6, from include/linux/sched.h:36, from init/main.c:29: include/linux/kernel.h:7:5: note: previous declaration of ‘printf’ with type ‘int(const char *, ...)’ 7 | int printf(const char * fmt, ...); | ^~~~~~ init/main.c: In function ‘printf’: init/main.c:185:52: warning: passing argument 3 of ‘vsprintf’ from incompatible pointer type [-Wincompatible-pointer-types] 185 | write(1,printbuf,i=vsprintf(printbuf, fmt, args)); | ^~~~ | | | va_list {aka char *} init/main.c:47:12: note: expected ‘__va_list_tag *’ but argument is of type ‘va_list’ {aka ‘char *’} 47 | extern int vsprintf(); | ^~~~~~~~ make: *** [Makefile:36: init/main.o] Error 1
|