Autor Thema: conflicting types for built-in function ‘printf’ trotz -nostdinc  (Gelesen 2448 mal)

Martin Erhardt

  • Beiträge: 165
    • Profil anzeigen
Gespeichert
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]

KtmnjjpfjsFvzG

  • Beiträge: 111
    • Profil anzeigen
Gespeichert
« Antwort #1 am: 02. February 2013, 12:36 »
Zeig mal den Code an der entsprechenden Stelle...

Martin Erhardt

  • Beiträge: 165
    • Profil anzeigen
Gespeichert
« Antwort #2 am: 02. February 2013, 13:41 »
#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){
    ...
}

MNemo

  • Beiträge: 547
    • Profil anzeigen
Gespeichert
« Antwort #3 am: 02. February 2013, 13:46 »
-nostdinc¹ 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²
« Letzte Änderung: 02. February 2013, 13:58 von MNemo »
„Wichtig ist nicht, besser zu sein als alle anderen. Wichtig ist, besser zu sein als du gestern warst!“

 

Einloggen