From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert de Bath Subject: More dev86 changes (0.16.5) Date: Wed, 24 Jul 2002 22:17:16 +0100 (BST) Sender: linux-8086-owner@vger.kernel.org Message-ID: <449ac7bad6f7380a@mayday.cix.co.uk> References: Mime-Version: 1.0 Return-path: In-Reply-To: List-Id: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Riley Williams Cc: Manuel Novoa III , Linux-8086 > 1) #elif support. In 0.16.5 Do we want #elifdef too? > 2) #warning support (at least for non-continued lines). In 0.16.5 > 3) Support asm() at file scope. This is to allow the equivalent > of #asm/#endasm in macros. In 0.16.5 > 4) Limited support for things like "#define stdio stdio". Stock bcc > goes into an infinite loop when encounting this. The implementation > has flaws, but it does what I needed. You see this a lot in the > glibc headers we're using with uClibc (yes I'm working on a port). Recursive defines are now trapped and skipped; it even protects against problems like: #define x z #define y x #define z y x y z > 6) True support for the "signed" keyword. At the moment, any file > using it has to include a "#define signed" line to remove it for > bcc, and in some cases, even that isn't enough as the code stops > working as a result. In 0.16.5, including 'signed char' typedefs, casts, variables and constant folding. AFAIK it all works as it should. However please note the _default_ char type is still unsigned. > 7) At least a warning message if any unrecognised options are given > on the command line. At the moment, unrecognised options are just > silently ignored! The bcc.c driver now checks options it would pass to ld86 and warns if there are any it doesn't know. So in all this now compiles and generates correct code in both 16 and 32 bit modes: (Or at least similar to: gcc -funsigned-char ) ---CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE--- #include #include #define strong_alias(Y,X) asm(\ "export _" "X", \ "_" "X" " = _" "Y" \ ); #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 #define signed unsigned #define 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; strong_alias(main,zulu); main() { int i1, i2, i3; c = -6; uc = -6; sc = -6; printf("%ld, ", (long)c); printf("%ld, ", (long)uc); printf("%ld\n", (long)sc); printf("%d, ", c); printf("%d, ", uc); printf("%d\n", sc); i1 = c; i2 = uc; i3 = sc; printf("%d, ", i1); printf("%d, ", i2); printf("%d\n", i3); i1 = (char) 200 + (char) 50; i2 = (t_uc) 200 + (t_uc) 50; i3 = (t_sc) 200 + (t_sc) 50; printf("%d, ", i1); printf("%d, ", i2); printf("%d\n", i3); c = 200; uc = 200; sc = 200; i1 = c + (long) 50; i2 = uc + (long) 50; i3 = sc + (long) 50; printf("%d, ", i1); printf("%d, ", i2); printf("%d\n", i3); } ---CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE--- -- Rob. (Robert de Bath )