Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 3.1.0-test3: gcc -ansi -pedantic



Thorsten Meinecke wrote:
> Hello, did anyone bother before to build zsh with gcc -ansi -pedantic?

Might as well complete the job:  (1) a pointer lacking a cast in
bin_read() (2) the function casts in module.c (3) the variable-sized
arrays in subst.c (which only affects gcc anyway).  The IRIX
<sys/termios.h> has pairs of ?'s in comments which gcc thinks are
supposed to be triglyphs, which is an additional annoyance.

*** Src/builtin.c.ansi	Mon Nov 18 09:27:19 1996
--- Src/builtin.c	Wed Nov 20 09:38:00 1996
***************
*** 4974,4980 ****
  	    putchar('\n');
  	}
  	if (!ops['e'])
! 	    setsparam(reply, line);
  	return 0;
      }
  
--- 4974,4980 ----
  	    putchar('\n');
  	}
  	if (!ops['e'])
! 	    setsparam(reply, (char *)line);
  	return 0;
      }
  
*** Src/module.c.ansi	Mon Nov 18 09:27:21 1996
--- Src/module.c	Wed Nov 20 09:50:41 1996
***************
*** 46,51 ****
--- 46,53 ----
  
  static LinkList modules;
  
+ typedef int (*Module_func) _((Module));
+ 
  /**/
  void *
  load_module(char *name)
***************
*** 77,83 ****
  {
      char *s, *t;
      char buf[PATH_MAX + 1];
!     int (*fn) _((Module));
  
      s = strrchr(m->nam, '/');
      if (s) {
--- 79,85 ----
  {
      char *s, *t;
      char buf[PATH_MAX + 1];
!     Module_func fn;
  
      s = strrchr(m->nam, '/');
      if (s) {
***************
*** 94,100 ****
  #else
      sprintf(buf, "boot_%s", s);
  #endif
!     fn = dlsym(m->handle, buf);
      return fn ? fn(m) : 1;
  }
  
--- 96,102 ----
  #else
      sprintf(buf, "boot_%s", s);
  #endif
!     fn = (Module_func)dlsym(m->handle, buf);
      return fn ? fn(m) : 1;
  }
  
***************
*** 104,110 ****
  {
      char *s, *t;
      char buf[PATH_MAX + 1];
!     int (*fn) _((Module));
  
      s = strrchr(m->nam, '/');
      if (s) {
--- 106,112 ----
  {
      char *s, *t;
      char buf[PATH_MAX + 1];
!     Module_func fn;
  
      s = strrchr(m->nam, '/');
      if (s) {
***************
*** 121,127 ****
  #else
      sprintf(buf, "cleanup_%s", s);
  #endif
!     fn = dlsym(m->handle, buf);
      return fn ? fn(m) : 0;
  }
  
--- 123,129 ----
  #else
      sprintf(buf, "cleanup_%s", s);
  #endif
!     fn = (Module_func)dlsym(m->handle, buf);
      return fn ? fn(m) : 0;
  }
  
*** Src/subst.c.ansi	Thu Oct 10 12:05:11 1996
--- Src/subst.c	Wed Nov 20 09:47:35 1996
***************
*** 447,453 ****
  cstrpcmp(const void *a, const void *b)
  {
  #ifdef HAVE_STRCOLL
! # ifdef __GNUC__
      char c[strlen(*(char **) a) + 1];
      char d[strlen(*(char **) b) + 1];
  # else
--- 447,453 ----
  cstrpcmp(const void *a, const void *b)
  {
  #ifdef HAVE_STRCOLL
! # if defined(__GNUC__) && !defined(__STRICT_ANSI__)
      char c[strlen(*(char **) a) + 1];
      char d[strlen(*(char **) b) + 1];
  # else
***************
*** 477,483 ****
  invcstrpcmp(const void *a, const void *b)
  {
  #ifdef HAVE_STRCOLL
! # ifdef __GNUC__
      char c[strlen(*(char **) a) + 1];
      char d[strlen(*(char **) b) + 1];
  # else
--- 477,483 ----
  invcstrpcmp(const void *a, const void *b)
  {
  #ifdef HAVE_STRCOLL
! # if defined(__GNUC__) && !defined(__STRICT_ANSI__)
      char c[strlen(*(char **) a) + 1];
      char d[strlen(*(char **) b) + 1];
  # else

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



Messages sorted by: Reverse Date, Date, Thread, Author