History

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'

seyko committed 11 years ago

Commit 3c372b41 parent dec95932 files · +4 −0Browse files

Unified · Split

2 files
  1. tcclib.h +2 −0
  2. tests/libtcc_test.c +2 −0
tcclib.h+2−0
@@ -39,6 +39,7 @@ int getchar(void); · 38 unmodified lines
3939 char *gets(char *s);
4040 int ungetc(int c, FILE *stream);
4141 int fflush(FILE *stream);
42+int putchar (int c);
4243
4344 int printf(const char *format, ...);
4445 int fprintf(FILE *stream, const char *format, ...);
@@ -64,6 +65,7 @@ void *memcpy(void *dest, const void *src, size_t n); · 19 unmodified lines
6465 void *memmove(void *dest, const void *src, size_t n);
6566 void *memset(void *s, int c, size_t n);
6667 char *strdup(const char *s);
68+size_t strlen(const char *s);
6769
6870 /* dlfcn.h */
6971 #define RTLD_LAZY 0x001
tests/libtcc_test.c+2−0
@@ -16,6 +16,8 @@ int add(int a, int b) · 15 unmodified lines
1616 }
1717
1818 char my_program[] =
19+"#include <stdio.h> // printf()\n"
20+"extern int add(int a, int b);\n"
1921 "int fib(int n)\n"
2022 "{\n"
2123 " if (n <= 2)\n"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t