remove a compilation warnings for libtest and test3

------------ libtest ------------
    ./libtcc_test lib_path=..
    <string>:11: warning: implicit declaration of function 'printf'
    <string>:13: warning: implicit declaration of function 'add'
    ------------ test3 ------------
    tcctest.c:1982: warning: implicit declaration of function 'putchar'
    tcctest.c:2133: warning: implicit declaration of function 'strlen'
This commit is contained in:
seyko 2015-04-10 06:44:34 +03:00
parent dec959358a
commit 3c372b4c8a
2 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,7 @@ int getchar(void);
char *gets(char *s); char *gets(char *s);
int ungetc(int c, FILE *stream); int ungetc(int c, FILE *stream);
int fflush(FILE *stream); int fflush(FILE *stream);
int putchar (int c);
int printf(const char *format, ...); int printf(const char *format, ...);
int fprintf(FILE *stream, const char *format, ...); int fprintf(FILE *stream, const char *format, ...);
@ -64,6 +65,7 @@ void *memcpy(void *dest, const void *src, size_t n);
void *memmove(void *dest, const void *src, size_t n); void *memmove(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n); void *memset(void *s, int c, size_t n);
char *strdup(const char *s); char *strdup(const char *s);
size_t strlen(const char *s);
/* dlfcn.h */ /* dlfcn.h */
#define RTLD_LAZY 0x001 #define RTLD_LAZY 0x001

View File

@ -16,6 +16,8 @@ int add(int a, int b)
} }
char my_program[] = char my_program[] =
"#include <stdio.h> // printf()\n"
"extern int add(int a, int b);\n"
"int fib(int n)\n" "int fib(int n)\n"
"{\n" "{\n"
" if (n <= 2)\n" " if (n <= 2)\n"