History

win32 defines + new internal file layer

bellard committed 24 years ago

Commit 9c065951 parent bbd541d2 files · +192 −87Browse files

Unified · Split

2 files
  1. bcheck.c +13 −6
  2. tcc.c +179 −81
bcheck.c+13−6
@@ -80,10 +80,12 @@ static void libc_free(void *ptr); · 79 unmodified lines
8080 static void install_malloc_hooks(void);
8181 static void restore_malloc_hooks(void);
8282
83+#ifndef WIN32
8384 static void *saved_malloc_hook;
8485 static void *saved_free_hook;
8586 static void *saved_realloc_hook;
8687 static void *saved_memalign_hook;
88+#endif
8789
8890 extern char _end;
8991
@@ -123,8 +125,7 @@ static BoundEntry *__bound_find_region(BoundEntry *e1, void *p) · 33 unmodified lines
123125 return __bound_empty_t2;
124126 }
125127
126−/* print a bound error and recurse thru 'nb_callers' to get the error
127− position */
128+/* print a bound error message */
128129 static void bound_error(const void *caller, const char *fmt, ...)
129130 {
130131 rt_error((unsigned long)caller, "%s", fmt);
@@ -132,7 +133,7 @@ static void bound_error(const void *caller, const char *fmt, ...) · 1 unmodified line
132133
133134 static void bound_alloc_error(void)
134135 {
135− bound_error(NULL, "not enough memory for bound checking code\n");
136+ bound_error(NULL, "not enough memory for bound checking code");
136137 }
137138
138139 /* currently, tcc cannot compile that because we use GNUC extensions */
@@ -406,7 +407,7 @@ void __bound_init(void) · 267 unmodified lines
406407 size = BOUND_T23_SIZE;
407408 mark_invalid(start, size);
408409
409−#if !defined(__TINYC__)
410+#if !defined(__TINYC__) && !defined(WIN32)
410411 /* malloc zone is also marked invalid */
411412 start = (unsigned long)&_end;
412413 size = 128 * 0x100000;
@@ -641,6 +642,7 @@ static unsigned long get_region_size(void *p) · 228 unmodified lines
641642
642643 static void install_malloc_hooks(void)
643644 {
645+#ifndef WIN32
644646 saved_malloc_hook = __malloc_hook;
645647 saved_free_hook = __free_hook;
646648 saved_realloc_hook = __realloc_hook;
@@ -649,14 +651,17 @@ static void install_malloc_hooks(void) · 2 unmodified lines
649651 __free_hook = __bound_free;
650652 __realloc_hook = __bound_realloc;
651653 __memalign_hook = __bound_memalign;
654+#endif
652655 }
653656
654657 static void restore_malloc_hooks(void)
655658 {
659+#ifndef WIN32
656660 __malloc_hook = saved_malloc_hook;
657661 __free_hook = saved_free_hook;
658662 __realloc_hook = saved_realloc_hook;
659663 __memalign_hook = saved_memalign_hook;
664+#endif
660665 }
661666
662667 static void *libc_malloc(size_t size)
@@ -693,6 +698,7 @@ void *__bound_malloc(size_t size, const void *caller) · 30 unmodified lines
693698 return ptr;
694699 }
695700
701+#ifndef WIN32
696702 void *__bound_memalign(size_t size, size_t align, const void *caller)
697703 {
698704 void *ptr;
@@ -711,6 +717,7 @@ void *__bound_memalign(size_t size, size_t align, const void *caller) · 12 unmodified lines
711717 __bound_new_region(ptr, size);
712718 return ptr;
713719 }
720+#endif
714721
715722 void __bound_free(void *ptr, const void *caller)
716723 {
@@ -773,7 +780,7 @@ static void bound_dump(void) · 56 unmodified lines
773780 /* some useful checked functions */
774781
775782 /* check that (p ... p + size - 1) lies inside 'p' region, if any */
776−static void __bound_check(const void *p, ssize_t size)
783+static void __bound_check(const void *p, size_t size)
777784 {
778785 if (size == 0)
779786 return;
@@ -805,7 +812,7 @@ void *__bound_memset(void *dst, int c, size_t size) · 25 unmodified lines
805812 return memset(dst, c, size);
806813 }
807814
808−/* resolve check check syms */
815+/* resolve bound check syms */
809816 typedef struct BCSyms {
810817 char *str;
811818 void *ptr;
tcc.c+179−81
@@ -25,11 +25,15 @@ · 24 unmodified lines
2525 #include <math.h>
2626 #include <unistd.h>
2727 #include <signal.h>
28+#include <malloc.h>
29+#include <unistd.h>
30+#include <fcntl.h>
31+#ifndef WIN32
2832 #include <sys/ucontext.h>
2933 #include <sys/mman.h>
30−#include <elf.h>
31−#include <stab.h>
32−#include <malloc.h>
34+#endif
35+#include "elf.h"
36+#include "stab.h"
3337 #ifndef CONFIG_TCC_STATIC
3438 #include <dlfcn.h>
3539 #endif
@@ -145,15 +149,22 @@ typedef struct AttributeDef { · 109 unmodified lines
145149 #define TYPE_ABSTRACT 1 /* type without variable */
146150 #define TYPE_DIRECT 2 /* type with variable */
147151
148−typedef struct {
149− FILE *file;
150− char *filename;
151− int line_num;
152−} IncludeFile;
152+#define IO_BUF_SIZE 8192
153+
154+typedef struct BufferedFile {
155+ unsigned char *buf_ptr;
156+ unsigned char *buf_end;
157+ int fd;
158+ int line_num; /* current line number - here to simply code */
159+ char filename[1024]; /* current filename - here to simply code */
160+ unsigned char buffer[IO_BUF_SIZE + 1]; /* extra size for CH_EOB char */
161+} BufferedFile;
162+
163+#define CH_EOB 0 /* end of buffer or '\0' char in file */
164+#define CH_EOF (-1) /* end of file */
153165
154166 /* parser */
155−FILE *file;
156−int line_num;
167+struct BufferedFile *file;
157168 int ch, ch1, tok, tok1;
158169 CValue tokc, tok1c;
159170
@@ -185,14 +196,14 @@ int tok_ident; · 25 unmodified lines
185196 TokenSym **table_ident;
186197 TokenSym *hash_ident[TOK_HASH_SIZE];
187198 char token_buf[STRING_MAX_SIZE + 1];
188−char *filename, *funcname;
199+char *funcname;
189200 /* contains global symbols which remain between each translation unit */
190201 SymStack extern_stack;
191202 SymStack define_stack, global_stack, local_stack, label_stack;
192203
193204 SValue vstack[VSTACK_SIZE], *vtop;
194205 int *macro_ptr, *macro_ptr_allocated;
195−IncludeFile include_stack[INCLUDE_STACK_SIZE], *include_stack_ptr;
206+BufferedFile *include_stack[INCLUDE_STACK_SIZE], **include_stack_ptr;
196207 int ifdef_stack[IFDEF_STACK_SIZE], *ifdef_stack_ptr;
197208 char *include_paths[INCLUDE_PATHS_MAX];
198209 int nb_include_paths;
@@ -316,6 +327,8 @@ int tcc_ext = 1; · 117 unmodified lines
316327 #define TOK_A_SHL 0x81
317328 #define TOK_A_SAR 0x82
318329
330+#define TOK_EOF (-1) /* end of file */
331+
319332 /* all identificators and strings have token above that */
320333 #define TOK_IDENT 256
321334
@@ -344,8 +357,10 @@ enum { · 22 unmodified lines
344357 TOK_LONG,
345358 TOK_REGISTER,
346359 TOK_SIGNED,
360+ TOK___SIGNED__, /* gcc keyword */
347361 TOK_AUTO,
348362 TOK_INLINE,
363+ TOK___INLINE__, /* gcc keyword */
349364 TOK_RESTRICT,
350365
351366 /* unsupported type */
@@ -392,9 +407,22 @@ enum { · 40 unmodified lines
392407 TOK___UNUSED__,
393408 };
394409
410+#ifdef WIN32
411+#define snprintf _snprintf
412+/* currently incorrect */
413+long double strtold(const char *nptr, char **endptr)
414+{
415+ return (long double)strtod(nptr, endptr);
416+}
417+float strtof(const char *nptr, char **endptr)
418+{
419+ return (float)strtod(nptr, endptr);
420+}
421+#else
395422 /* XXX: need to define this to use them in non ISOC99 context */
396423 extern float strtof (const char *__nptr, char **__endptr);
397424 extern long double strtold (const char *__nptr, char **__endptr);
425+#endif
398426
399427 void sum(int l);
400428 void next(void);
@@ -495,7 +523,7 @@ static TCCSyms tcc_syms[] = { · 94 unmodified lines
495523 { NULL, NULL },
496524 };
497525
498−void *dlsym(void *handle, char *symbol)
526+void *dlsym(void *handle, const char *symbol)
499527 {
500528 TCCSyms *p;
501529 p = tcc_syms;
@@ -582,25 +610,27 @@ unsigned long long __ldtoull(long double a) · 80 unmodified lines
582610
583611 /********************************************************/
584612
585−/* copy a string and truncate it */
613+/* copy a string and truncate it. */
586614 char *pstrcpy(char *buf, int buf_size, const char *s)
587615 {
588616 char *q, *q_end;
589617 int c;
590618
591− q = buf;
592− q_end = buf + buf_size - 1;
593− while (q < q_end) {
594− c = *s++;
595− if (c == '\0')
596− break;
597− *q++ = c;
619+ if (buf_size > 0) {
620+ q = buf;
621+ q_end = buf + buf_size - 1;
622+ while (q < q_end) {
623+ c = *s++;
624+ if (c == '\0')
625+ break;
626+ *q++ = c;
627+ }
628+ *q = '\0';
598629 }
599− *q = '\0';
600630 return buf;
601631 }
602632
603−/* strcat and truncate */
633+/* strcat and truncate. */
604634 char *pstrcat(char *buf, int buf_size, const char *s)
605635 {
606636 int len;
@@ -624,12 +654,19 @@ Section *new_section(const char *name, int sh_type, int sh_flags) · 17 unmodified lines
624654 sec->sh_num = ++section_num;
625655 sec->sh_type = sh_type;
626656 sec->sh_flags = sh_flags;
657+#ifdef WIN32
658+ /* XXX: currently, a single malloc */
659+ data = malloc(SECTION_VSIZE);
660+ if (data == NULL)
661+ error("could not alloc section '%s'", name);
662+#else
627663 data = mmap(NULL, SECTION_VSIZE,
628664 PROT_EXEC | PROT_READ | PROT_WRITE,
629665 MAP_PRIVATE | MAP_ANONYMOUS,
630666 -1, 0);
631667 if (data == (void *)(-1))
632668 error("could not mmap section '%s'", name);
669+#endif
633670 sec->data = data;
634671 sec->data_ptr = data;
635672 psec = &first_section;
@@ -706,11 +743,11 @@ static inline int toup(int c) · 70 unmodified lines
706743
707744 void printline(void)
708745 {
709− IncludeFile *f;
746+ BufferedFile **f;
710747 for(f = include_stack; f < include_stack_ptr; f++)
711748 fprintf(stderr, "In file included from %s:%d:\n",
712− f->filename, f->line_num);
713− fprintf(stderr, "%s:%d: ", filename, line_num);
749+ (*f)->filename, (*f)->line_num);
750+ fprintf(stderr, "%s:%d: ", file->filename, file->line_num);
714751 }
715752
716753 void error(const char *fmt, ...)
@@ -976,39 +1013,94 @@ void sym_undef(SymStack *st, Sym *s) · 259 unmodified lines
9761013 s->v = 0;
9771014 }
9781015
1016+/* I/O layer */
1017+
1018+BufferedFile *tcc_open(const char *filename)
1019+{
1020+ int fd;
1021+ BufferedFile *bf;
1022+
1023+ fd = open(filename, O_RDONLY);
1024+ if (fd < 0)
1025+ return NULL;
1026+ bf = malloc(sizeof(BufferedFile));
1027+ if (!bf) {
1028+ close(fd);
1029+ return NULL;
1030+ }
1031+ bf->fd = fd;
1032+ bf->buf_ptr = bf->buffer;
1033+ bf->buf_end = bf->buffer;
1034+ bf->buffer[0] = CH_EOB; /* put eob symbol */
1035+ pstrcpy(bf->filename, sizeof(bf->filename), filename);
1036+ bf->line_num = 1;
1037+ return bf;
1038+}
1039+
1040+void tcc_close(BufferedFile *bf)
1041+{
1042+ close(bf->fd);
1043+ free(bf);
1044+}
1045+
1046+/* read one char. MUST call tcc_fillbuf if CH_EOB is read */
1047+#define TCC_GETC(bf) (*(bf)->buf_ptr++)
1048+
1049+/* fill input buffer and return next char */
1050+int tcc_getc_slow(BufferedFile *bf)
1051+{
1052+ int len;
1053+ /* only tries to read if really end of buffer */
1054+ if (bf->buf_ptr >= bf->buf_end) {
1055+ if (bf->fd != -1) {
1056+ len = read(bf->fd, bf->buffer, IO_BUF_SIZE);
1057+ if (len < 0)
1058+ len = 0;
1059+ } else {
1060+ len = 0;
1061+ }
1062+ bf->buf_ptr = bf->buffer;
1063+ bf->buf_end = bf->buffer + len;
1064+ *bf->buf_end = CH_EOB;
1065+ }
1066+ if (bf->buf_ptr < bf->buf_end) {
1067+ return *bf->buf_ptr++;
1068+ } else {
1069+ bf->buf_ptr = bf->buf_end;
1070+ return CH_EOF;
1071+ }
1072+}
1073+
9791074 /* no need to put that inline */
980−int handle_eof(void)
1075+void handle_eob(void)
9811076 {
982− if (include_stack_ptr == include_stack)
983− return -1;
984− /* add end of include file debug info */
985− if (do_debug) {
986− put_stabd(N_EINCL, 0, 0);
1077+ for(;;) {
1078+ ch1 = tcc_getc_slow(file);
1079+ if (ch1 != CH_EOF)
1080+ return;
1081+
1082+ if (include_stack_ptr == include_stack)
1083+ return;
1084+ /* add end of include file debug info */
1085+ if (do_debug) {
1086+ put_stabd(N_EINCL, 0, 0);
1087+ }
1088+ /* pop include stack */
1089+ tcc_close(file);
1090+ include_stack_ptr--;
1091+ file = *include_stack_ptr;
9871092 }
988− /* pop include stack */
989− fclose(file);
990− free(filename);
991− include_stack_ptr--;
992− file = include_stack_ptr->file;
993− filename = include_stack_ptr->filename;
994− line_num = include_stack_ptr->line_num;
995− return 0;
9961093 }
9971094
9981095 /* read next char from current input file */
9991096 static inline void inp(void)
10001097 {
1001− redo:
1002− /* faster than fgetc */
1003− ch1 = getc_unlocked(file);
1004− if (ch1 == -1) {
1005− if (handle_eof() < 0)
1006− return;
1007− else
1008− goto redo;
1009− }
1098+ ch1 = TCC_GETC(file);
1099+ /* end of buffer/file handling */
1100+ if (ch1 == CH_EOB)
1101+ handle_eob();
10101102 if (ch1 == '\n')
1011− line_num++;
1103+ file->line_num++;
10121104 // printf("ch1=%c 0x%x\n", ch1, ch1);
10131105 }
10141106
@@ -1219,7 +1311,7 @@ void preprocess(void) · 204 unmodified lines
12191311 int size, i, c, v, t, *str, len;
12201312 char buf[1024], *q, *p;
12211313 char buf1[1024];
1222− FILE *f;
1314+ BufferedFile *f;
12231315 Sym **ps, *first, *s;
12241316
12251317 cinp();
@@ -1304,15 +1396,15 @@ void preprocess(void) · 78 unmodified lines
13041396 if (c == '\"') {
13051397 /* first search in current dir if "header.h" */
13061398 size = 0;
1307− p = strrchr(filename, '/');
1399+ p = strrchr(file->filename, '/');
13081400 if (p)
1309− size = p + 1 - filename;
1401+ size = p + 1 - file->filename;
13101402 if (size > sizeof(buf1) - 1)
13111403 size = sizeof(buf1) - 1;
1312− memcpy(buf1, filename, size);
1404+ memcpy(buf1, file->filename, size);
13131405 buf1[size] = '\0';
13141406 pstrcat(buf1, sizeof(buf1), buf);
1315− f = fopen(buf1, "r");
1407+ f = tcc_open(buf1);
13161408 if (f)
13171409 goto found;
13181410 }
@@ -1321,7 +1413,7 @@ void preprocess(void) · 2 unmodified lines
13211413 strcpy(buf1, include_paths[i]);
13221414 strcat(buf1, "/");
13231415 strcat(buf1, buf);
1324− f = fopen(buf1, "r");
1416+ f = tcc_open(buf1);
13251417 if (f)
13261418 goto found;
13271419 }
@@ -1330,16 +1422,11 @@ void preprocess(void) · 2 unmodified lines
13301422 found:
13311423 /* push current file in stack */
13321424 /* XXX: fix current line init */
1333− include_stack_ptr->file = file;
1334− include_stack_ptr->filename = filename;
1335− include_stack_ptr->line_num = line_num;
1336− include_stack_ptr++;
1425+ *include_stack_ptr++ = file;
13371426 file = f;
1338− filename = strdup(buf1);
1339− line_num = 1;
13401427 /* add include file debug info */
13411428 if (do_debug) {
1342− put_stabs(filename, N_BINCL, 0, 0, 0);
1429+ put_stabs(file->filename, N_BINCL, 0, 0, 0);
13431430 }
13441431 } else if (tok == TOK_IFNDEF) {
13451432 c = 1;
@@ -1382,14 +1469,14 @@ void preprocess(void) · 36 unmodified lines
13821469 next();
13831470 if (tok != TOK_CINT)
13841471 error("#line");
1385− line_num = tokc.i;
1472+ file->line_num = tokc.i;
13861473 skip_spaces();
13871474 if (ch != '\n') {
13881475 next();
13891476 if (tok != TOK_STR)
13901477 error("#line");
1391− /* XXX: potential memory leak */
1392− filename = strdup(get_tok_str(tok, &tokc));
1478+ pstrcpy(file->filename, sizeof(file->filename),
1479+ get_tok_str(tok, &tokc));
13931480 }
13941481 } else if (tok == TOK_ERROR) {
13951482 error("#error");
@@ -2025,10 +2112,10 @@ void macro_subst(int **tok_str, int *tok_len, · 629 unmodified lines
20252112 break;
20262113 /* special macros */
20272114 if (tok == TOK___LINE__) {
2028− cval.i = line_num;
2115+ cval.i = file->line_num;
20292116 tok_add2(tok_str, tok_len, TOK_CINT, &cval);
20302117 } else if (tok == TOK___FILE__) {
2031− cval.ts = tok_alloc(filename, 0);
2118+ cval.ts = tok_alloc(file->filename, 0);
20322119 tok_add2(tok_str, tok_len, TOK_STR, &cval);
20332120 } else if (tok == TOK___DATE__) {
20342121 cval.ts = tok_alloc("Jan 1 1970", 0);
@@ -3912,8 +3999,10 @@ int parse_btype(int *type_ptr, AttributeDef *ad) · 1877 unmodified lines
39123999 case TOK_VOLATILE:
39134000 case TOK_REGISTER:
39144001 case TOK_SIGNED:
4002+ case TOK___SIGNED__:
39154003 case TOK_AUTO:
39164004 case TOK_INLINE:
4005+ case TOK___INLINE__:
39174006 case TOK_RESTRICT:
39184007 next();
39194008 break;
@@ -4665,10 +4754,10 @@ void block(int *bsym, int *csym, int *case_sym, int *def_sym, int case_reg) · 745 unmodified lines
46654754
46664755 /* generate line number info */
46674756 if (do_debug &&
4668− (last_line_num != line_num || last_ind != ind)) {
4669− put_stabn(N_SLINE, 0, line_num, ind - func_ind);
4757+ (last_line_num != file->line_num || last_ind != ind)) {
4758+ put_stabn(N_SLINE, 0, file->line_num, ind - func_ind);
46704759 last_ind = ind;
4671− last_line_num = line_num;
4760+ last_line_num = file->line_num;
46724761 }
46734762
46744763 if (tok == TOK_IF) {
@@ -5339,7 +5428,7 @@ void put_func_debug(int t) · 664 unmodified lines
53395428 /* XXX: we put here a dummy type */
53405429 snprintf(buf, sizeof(buf), "%s:%c1",
53415430 funcname, t & VT_STATIC ? 'f' : 'F');
5342− put_stabs(buf, N_FUN, 0, line_num, ind);
5431+ put_stabs(buf, N_FUN, 0, file->line_num, ind);
53435432 func_ind = ind;
53445433 last_ind = 0;
53455434 last_line_num = 0;
@@ -5533,13 +5622,11 @@ int tcc_compile_file(const char *filename1) · 187 unmodified lines
55335622 Sym *define_start;
55345623 char buf[512];
55355624
5536− line_num = 1;
55375625 funcname = "";
5538− filename = (char *)filename1;
55395626
5540− file = fopen(filename, "r");
5627+ file = tcc_open(filename1);
55415628 if (!file)
5542− error("file '%s' not found", filename);
5629+ error("file '%s' not found", filename1);
55435630 include_stack_ptr = include_stack;
55445631 ifdef_stack_ptr = ifdef_stack;
55455632
@@ -5551,7 +5638,8 @@ int tcc_compile_file(const char *filename1) · 5 unmodified lines
55515638 getcwd(buf, sizeof(buf));
55525639 pstrcat(buf, sizeof(buf), "/");
55535640 put_stabs(buf, N_SO, 0, 0, (unsigned long)text_section->data_ptr);
5554− put_stabs(filename, N_SO, 0, 0, (unsigned long)text_section->data_ptr);
5641+ put_stabs(file->filename, N_SO, 0, 0,
5642+ (unsigned long)text_section->data_ptr);
55555643 }
55565644 /* define common 'char *' type because it is often used internally
55575645 for arrays and struct dereference */
@@ -5564,7 +5652,7 @@ int tcc_compile_file(const char *filename1) · 6 unmodified lines
55645652 decl(VT_CONST);
55655653 if (tok != -1)
55665654 expect("declaration");
5567− fclose(file);
5655+ tcc_close(file);
55685656
55695657 /* end of translation unit info */
55705658 if (do_debug) {
@@ -5993,6 +6081,7 @@ void rt_error(unsigned long pc, const char *fmt, ...) · 422 unmodified lines
59936081 va_end(ap);
59946082 }
59956083
6084+#ifndef WIN32
59966085 /* signal handler for fatal errors */
59976086 static void sig_error(int signum, siginfo_t *siginf, void *puc)
59986087 {
@@ -6033,19 +6122,23 @@ static void sig_error(int signum, siginfo_t *siginf, void *puc) · 34 unmodified lines
60336122 }
60346123 exit(255);
60356124 }
6125+#endif
60366126
60376127 /* launch the compiled program with the given arguments */
60386128 int launch_exe(int argc, char **argv)
60396129 {
60406130 Sym *s;
60416131 int (*t)();
6042− struct sigaction sigact;
60436132
60446133 s = sym_find1(&extern_stack, TOK_MAIN);
60456134 if (!s || (s->r & VT_FORWARD))
60466135 error("main() not defined");
60476136
60486137 if (do_debug) {
6138+#ifdef WIN32
6139+ error("debug mode currently not available for Windows");
6140+#else
6141+ struct sigaction sigact;
60496142 /* install TCC signal handlers to print debug info on fatal
60506143 runtime errors */
60516144 sigact.sa_flags = SA_SIGINFO | SA_ONESHOT;
@@ -6056,9 +6149,13 @@ int launch_exe(int argc, char **argv) · 4 unmodified lines
60566149 sigaction(SIGSEGV, &sigact, NULL);
60576150 sigaction(SIGBUS, &sigact, NULL);
60586151 sigaction(SIGABRT, &sigact, NULL);
6152+#endif
60596153 }
60606154
60616155 if (do_bounds_check) {
6156+#ifdef WIN32
6157+ error("bound checking currently not available for Windows");
6158+#else
60626159 int *p, *p_end;
60636160 __bound_init();
60646161 /* add all known static regions */
@@ -6068,6 +6165,7 @@ int launch_exe(int argc, char **argv) · 3 unmodified lines
60686165 __bound_new_region((void *)p[0], p[1]);
60696166 p += 2;
60706167 }
6168+#endif
60716169 }
60726170
60736171 t = (int (*)())s->c;
@@ -6077,7 +6175,7 @@ int launch_exe(int argc, char **argv) · 3 unmodified lines
60776175
60786176 void help(void)
60796177 {
6080− printf("tcc version 0.9.3 - Tiny C Compiler - Copyright (C) 2001, 2002 Fabrice Bellard\n"
6178+ printf("tcc version 0.9.4 - Tiny C Compiler - Copyright (C) 2001, 2002 Fabrice Bellard\n"
60816179 "usage: tcc [-Idir] [-Dsym[=val]] [-Usym] [-llib] [-g] [-b]\n"
60826180 " [-i infile] infile [infile_args...]\n"
60836181 "\n"
@@ -6103,7 +6201,7 @@ int main(int argc, char **argv) · 19 unmodified lines
61036201
61046202 /* add all tokens */
61056203 tok_ident = TOK_IDENT;
6106− p = "int\0void\0char\0if\0else\0while\0break\0return\0for\0extern\0static\0unsigned\0goto\0do\0continue\0switch\0case\0const\0volatile\0long\0register\0signed\0auto\0inline\0restrict\0float\0double\0_Bool\0short\0struct\0union\0typedef\0default\0enum\0sizeof\0__attribute__\0define\0include\0ifdef\0ifndef\0elif\0endif\0defined\0undef\0error\0line\0__LINE__\0__FILE__\0__DATE__\0__TIME__\0__VA_ARGS__\0__func__\0main\0section\0__section__\0aligned\0__aligned__\0unused\0__unused__\0";
6204+ p = "int\0void\0char\0if\0else\0while\0break\0return\0for\0extern\0static\0unsigned\0goto\0do\0continue\0switch\0case\0const\0volatile\0long\0register\0signed\0__signed__\0auto\0inline\0__inline__\0restrict\0float\0double\0_Bool\0short\0struct\0union\0typedef\0default\0enum\0sizeof\0__attribute__\0define\0include\0ifdef\0ifndef\0elif\0endif\0defined\0undef\0error\0line\0__LINE__\0__FILE__\0__DATE__\0__TIME__\0__VA_ARGS__\0__func__\0main\0section\0__section__\0aligned\0__aligned__\0unused\0__unused__\0";
61076205 while (*p) {
61086206 r = p;
61096207 while (*r++);

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