Lowlevel
Lowlevel => Lowlevel-Coding => Thema gestartet von: Martin Erhardt am 02. February 2013, 11:30
-
bei der Implementierung meines Syscalls habe ich folgendes Problem:
gcc -m32 -Werror -Wall -g -fno-stack-protector -nostdinc -I lib -c -o tst.o tst.c
tst.c:5:6: error: conflicting types for built-in function ‘printf’ [-Werror]
-
Zeig mal den Code an der entsprechenden Stelle...
-
#include <stdint.h>
#define SYS_WRITE 0
void printf(const char* fmt, ...);
void printfstrcol_scr(uint8_t font, const char* fmt);
void _start(void)
{
printf("sghs");
while(1);
}
void printf(const char* fmt, ...){
uprintfstrcol_scr(0xF0,fmt);
}
void printfstrcol_scr(uint8_t font, const char* fmt){
...
}
-
-nostdinc¹ (http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Preprocessor-Options.html#index-nostdinc-943) sagt nur wo nach header-dateien gesucht werden soll, und hat nix mit built-in funktionen zu tun.
Das flag das du brauchst heißt -ffreestanding² (http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/C-Dialect-Options.html#index-ffreestanding-111)