Note that there are some explanatory texts on larger screens.

plurals
  1. POcompiling my own kernel (not from linux-kernel source)
    primarykey
    data
    text
    <p>I'm following the kernel tutorial from <a href="http://www.osdever.net/bkerndev/Docs/intro.htm" rel="nofollow noreferrer">here</a></p> <p>im having problems compiling my files.</p> <p>i get the following errors when i try to compile:</p> <pre><code>main.c:8: error: expected declaration specifiers or ‘...’ before ‘size_t’ main.c:8: error: conflicting types for ‘memcpy’ ./include/system.h:5: note: previous declaration of ‘memcpy’ was here main.c: In function ‘memcpy’: main.c:12: error: ‘count’ undeclared (first use in this function) main.c:12: error: (Each undeclared identifier is reported only once main.c:12: error: for each function it appears in.) main.c: At top level: main.c:16: error: expected declaration specifiers or ‘...’ before ‘size_t’ main.c:16: error: conflicting types for ‘memset’ ./include/system.h:6: note: previous declaration of ‘memset’ was here main.c: In function ‘memset’: main.c:19: error: ‘count’ undeclared (first use in this function) main.c: At top level: main.c:23: error: expected declaration specifiers or ‘...’ before ‘size_t’ main.c:23: error: conflicting types for ‘memsetw’ ./include/system.h:7: note: previous declaration of ‘memsetw’ was here main.c: In function ‘memsetw’: main.c:26: error: ‘count’ undeclared (first use in this function) main.c: At top level: main.c:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strlen’ main.c:49: warning: return type of ‘main’ is not ‘int’ main.c: In function ‘main’: main.c:64: warning: pointer targets in passing argument 1 of ‘puts’ differ in signedness ./include/system.h:13: note: expected ‘unsigned char *’ but argument is of type ‘char *’ main.c:51: warning: unused variable ‘i’ scrn.c: In function ‘scroll’: scrn.c:24: warning: passing argument 1 of ‘memcpy’ from incompatible pointer type ./include/system.h:5: note: expected ‘unsigned char *’ but argument is of type ‘short unsigned int *’ scrn.c:24: warning: passing argument 2 of ‘memcpy’ from incompatible pointer type ./include/system.h:5: note: expected ‘const unsigned char *’ but argument is of type ‘short unsigned int *’ scrn.c: In function ‘puts’: scrn.c:139: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness ./include/system.h:8: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ </code></pre> <p>My files are exact copies of the ones from the tutorial.<br> I can see that in main.c the functions are defined like so</p> <p><code> void *memcpy(void *dest,const void *src, size_t count) </code></p> <p>but in my system.h file they are defined like so</p> <p><code> extern unsigned char *memcpy(unsigned char *dest,const unsigned char *src, int count) </code></p> <p>C is not my primary language but i am in the process of learning it so I apologize if my question is simple but I would think that these definitions should be the same not?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload