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
39char *gets(char *s);39char *gets(char *s);
40int ungetc(int c, FILE *stream);40int ungetc(int c, FILE *stream);
41int fflush(FILE *stream);41int fflush(FILE *stream);
42int putchar (int c);
42 43
43int printf(const char *format, ...);44int printf(const char *format, ...);
44int fprintf(FILE *stream, const char *format, ...);45int fprintf(FILE *stream, const char *format, ...);
@@ -64,6 +65,7 @@ void *memcpy(void *dest, const void *src, size_t n); · 19 unmodified lines
64void *memmove(void *dest, const void *src, size_t n);65void *memmove(void *dest, const void *src, size_t n);
65void *memset(void *s, int c, size_t n);66void *memset(void *s, int c, size_t n);
66char *strdup(const char *s);67char *strdup(const char *s);
68size_t strlen(const char *s);
67 69
68/* dlfcn.h */70/* dlfcn.h */
69#define RTLD_LAZY 0x00171#define RTLD_LAZY 0x001
tests/libtcc_test.c+2−0
@@ -16,6 +16,8 @@ int add(int a, int b) · 15 unmodified lines
16}16}
17 17
18char my_program[] =18char my_program[] =
19"#include <stdio.h> // printf()\n"
20"extern int add(int a, int b);\n"
19"int fib(int n)\n"21"int fib(int n)\n"
20"{\n"22"{\n"
21" if (n <= 2)\n"23" 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