From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id AAA26172 for ; Wed, 8 May 1996 00:46:56 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA12118; Tue, 7 May 1996 10:13:33 -0400 (EDT) Resent-Date: Tue, 7 May 1996 10:13:33 -0400 (EDT) Message-Id: <199605071412.QAA03445@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: fdtable In-reply-to: "a.main@dcs.warwick.ac.uk"'s message of "Tue, 07 May 1996 12:19:23 MET." <28910.199605071119@stone.dcs.warwick.ac.uk> Date: Tue, 07 May 1996 16:12:32 +0200 From: Peter Stephenson Resent-Message-ID: <"_ooQ12.0.Dz2.CgrZn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/994 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > >Shouldn't fdtable[] be `signed char'? (Yes.) > > Careful! The `signed' keyword does not exist in K&R C. We should > either avoid its usage altogether, or do a feature test for it. I > think all K&R compilers have char signed by default, so this should > work. OK, here's a configure version. I haven't rerun autoconf; that needs to be done for this to take effect. By the way, the previous test in configure, for casting signed to unsigned, isn't being cached properly. I think that's because of the name of the variable. *** config.h.in.sig Tue May 7 15:42:38 1996 --- config.h.in Tue May 7 15:57:52 1996 *************** *** 96,101 **** --- 96,104 ---- /* Define to 1 if compiler incorrectly cast signed to unsigned */ #undef BROKEN_SIGNED_TO_UNSIGNED_CASTING + /* Define to 1 if compiler handles `signed' keyword */ + #undef HAVE_SIGNED_KEYWORD + /* Define if your system defines TIOCGWINSZ in sys/ioctl.h. */ #undef GWINSZ_IN_SYS_IOCTL *** configure.in.sig Fri May 3 20:54:33 1996 --- configure.in Tue May 7 16:00:39 1996 *************** *** 154,159 **** --- 154,167 ---- AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING) fi + dnl Checking if complier handles `signed' keyword + AC_CACHE_CHECK(if the signed keyword is handled, zsh_cv_signed_keyword, + [AC_TRY_COMPILE(, [signed char foo; foo = -1;], + zsh_cv_signed_keyword=yes, zsh_cv_signed_keyword=no)]) + if test $zsh_cv_signed_keyword = yes; then + AC_DEFINE(HAVE_SIGNED_KEYWORD) + fi + dnl ------------------ dnl CHECK FOR PROGRAMS dnl ------------------ *** Src/globals.h.sig Tue May 7 15:43:49 1996 --- Src/globals.h Tue May 7 15:56:39 1996 *************** *** 397,403 **** --- 397,408 ---- * table is not used. A table element is set by movefd and cleard * * by zclose. */ + #ifdef HAVE_SIGNED_KEYWORD + EXTERN signed char fdtable[OPEN_MAX]; + #else + /* If `signed' does not exist, we assume char's are signed anyway. */ EXTERN char fdtable[OPEN_MAX]; + #endif /* input fd from the coprocess */ -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.