diff -Nurd linux86.old/Makefile linux86/Makefile --- linux86.old/Makefile Sun Aug 4 10:17:16 2002 +++ linux86/Makefile Sun Aug 11 08:07:23 2002 @@ -2,7 +2,7 @@ # This file is part of the Linux-8086 Development environment and is # distributed under the GNU General Public License. -VERSION=0.16.8 +VERSION=0.16.9 TARGETS= \ clean bcc unproto copt as86 ld86 elksemu \ diff -Nurd linux86.old/bcc/bcc.c linux86/bcc/bcc.c --- linux86.old/bcc/bcc.c Sun Aug 11 07:37:01 2002 +++ linux86/bcc/bcc.c Mon Aug 19 10:20:59 2002 @@ -503,6 +503,8 @@ } if (err) fprintf(stderr, "warning: linker option %s not recognised.\n", option); + else if (!do_link) + fprintf(stderr, "warning: linker option %s unused.\n", option); } void @@ -518,6 +520,15 @@ for(next_file = files; next_file; next_file = next_file->next) validate_link_opt(next_file->file); + + if (!do_link) { + if (opt_i) + fprintf(stderr, "warning: linker option -i unused.\n"); + if (opt_x) + fprintf(stderr, "warning: linker option -x unused.\n"); + if (opt_L) + fprintf(stderr, "warning: linker option -L unused.\n"); + } } void @@ -931,16 +942,20 @@ break; case 'd': /* DOS COM file */ prepend_option("-D__MSDOS__", 'p'); - libc="-ldos"; - append_option("-d", 'l'); - append_option("-T100", 'l'); + if (do_link) { + libc="-ldos"; + append_option("-d", 'l'); + append_option("-T100", 'l'); + } break; case 'l': /* 386 Linux a.out */ opt_arch=1; prepend_option("-D__unix__", 'p'); prepend_option("-D__linux__", 'p'); - libc="-lc"; - append_option("-N", 'l'); + if (do_link) { + libc="-lc"; + append_option("-N", 'l'); + } break; case 'g': /* 386 Linux object using gcc as linker */ opt_arch = 2; Binary files linux86.old/cpp/c and linux86/cpp/c differ diff -Nurd linux86.old/cpp/c.c linux86/cpp/c.c --- linux86.old/cpp/c.c Sun Aug 11 07:33:53 2002 +++ linux86/cpp/c.c Tue Aug 13 21:05:15 2002 @@ -7,29 +7,33 @@ #define strong_alias(Y,X) asm("export _" "X", "_" "X" " = _" "Y" ) #endif -#if __STDC__ -#define comb(x,y) x ## y -#warning Using Ansi combine -#elif __BCC__ -#define comb(x,y) x/**/y -#warning Using bcc combine -#else -#define comb(x,y) x/**/y -#warning Using K&R combine +#if 1 +# if __STDC__ +# define comb(x,y) x ## y +# warning Using Ansi combine +# elif __BCC__ +# define comb(x,y) x/**/y +# warning Using bcc combine +# else +# define comb(x,y) x/**/y +# warning Using K&R combine +# endif #endif -#define signed unsigned -#define unsigned signed +#define o define +#o signed unsigned +#o unsigned signed #ifdef signed typedef signed char t_sc; typedef comb(un,signed) char t_uc; -#endif char c; t_sc sc; t_uc uc; +#endif +#pragma full optimise strong_alias(main,zulu); main() { diff -Nurd linux86.old/cpp/cpp.c linux86/cpp/cpp.c --- linux86.old/cpp/cpp.c Sun Aug 11 07:33:57 2002 +++ linux86/cpp/cpp.c Tue Aug 13 22:15:44 2002 @@ -23,17 +23,18 @@ * c_lineno Current line number in file being parsed. * * alltok Control flag for the kind of tokens you want (C or generic) - * dislect Control flag to change the preprocessor for Ansi C. + * dialect Control flag to change the preprocessor for Ansi C. * * TODO: * #asm -> asm("...") translation. * ?: in #if expressions - * __DATE__ and __TIME__ macros. - * Add #line directive. - * Poss: Seperate current directory for #include from errors (#line). - * Poss: C99 Variable macro args. + * Complete #line directive. * \n in "\n" in a stringized argument. * Comments in stringized arguments should be deleted. + * + * Poss: Seperate current directory for #include from errors (#line). + * (For editors that hunt down source files) + * Poss: C99 Variable macro args. */ #define KEEP_SPACE 0 @@ -83,7 +84,7 @@ static int if_false = 0; static int if_has_else = 0; static int if_hidden = 0; -static int if_stack = 0; +static unsigned int if_stack = 0; struct arg_store { char * name; @@ -276,7 +277,7 @@ if( cc < WORDSIZE-1 ) *p++ = ch; /* Clip to WORDSIZE */ *p = '\0'; cc++; ch = chget(); - if (ch == 1) ch = chget(); + if (ch == SYN) ch = chget(); } break_break: /* Numbers */ @@ -671,7 +672,10 @@ cwarn(curword); } else if( strcmp(curword, "pragma") == 0 ) { do_proc_copy_hashline(); pgetc(); - /* Ignore #pragma */ + /* Ignore #pragma ? */ + } else if( strcmp(curword, "line") == 0 ) { + do_proc_copy_hashline(); pgetc(); + /* Ignore #line for now. */ } else if( strcmp(curword, "asm") == 0 ) { alltok |= 0x100; return do_proc_copy_hashline(); @@ -905,6 +909,13 @@ int type; { int ch = 0; + if(if_false && if_hidden) + { + if( type != 3 ) if_hidden++; + do_proc_tail(); + return 0; + } + if( type == 3 ) { if( if_count == 0 ) diff -Nurd linux86.old/cpp/main.c linux86/cpp/main.c --- linux86.old/cpp/main.c Sat Aug 3 08:07:16 2002 +++ linux86/cpp/main.c Tue Aug 13 20:51:16 2002 @@ -7,6 +7,7 @@ #include #include #include +#include #include "cc.h" @@ -137,6 +138,22 @@ if (!curfile) cfatal(Usage); + + /* Define date and time macros. */ + if (dialect != DI_KNR) { + time_t now; + char * timep; + char buf[128]; + time(&now); + timep = ctime(&now); + + /* Yes, well */ + sprintf(buf, "__TIME__=\"%.8s\"", timep + 11); + define_macro(buf); + /* US order; Seems to be mandated by standard. */ + sprintf(buf, "__DATE__=\"%.3s %.2s %.4s\"", timep + 4, timep + 8, timep + 20); + define_macro(buf); + } if (outfile) ofd = fopen(outfile, "w"); else ofd = stdout; diff -Nurd linux86.old/ld/syshead.h linux86/ld/syshead.h --- linux86.old/ld/syshead.h Wed Mar 20 22:35:04 2002 +++ linux86/ld/syshead.h Sat Aug 24 07:20:00 2002 @@ -23,8 +23,8 @@ #define R_OK 0 #define mode_t unsigned short #define SEEK_SET 0 -#define STDOUT_FILENO 0 -#define STDERR_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 #define VERSION "MSDOS Compile" #endif @@ -55,7 +55,7 @@ #define R_OK 0 int access P((const char *path, int amode)); #define SEEK_SET 0 -#define STDOUT_FILENO 0 +#define STDOUT_FILENO 1 #define STDERR_FILENO 2 #define mode_t unsigned short