From: jtc@gain.COM (J.T. Conklin)
Subject: sed-1.11: sunos4.1, solaris2, aix3.2, irix 4.0.1, hpux 8.07, etc.
Reply-To: jtc@gain.com
Organization: GAIN Technology Inc., Palo Alto, CA
Distribution: gnu
Date: Wed, 14 Oct 1992 06:27:11 GMT

I installed gnu sed-1.11 on all of the machines I have available to
me.  Except for irix, all went well.

The Irix compiler understands const, even though __STDC__ is not
defined.  Function prototype conflicts between stdio.h and stdlib.h
occur because regex.h defines const to "", if __STDC__ is not defined.

[ system() is defined in both stdio.h and stdlib.h.  It is declared
  as ``extern int system(const char *s);''.  If regex.h is included
  between the two, the second declaration becomes ``extern int
  system(char *s);'', which conflicts with the first ]

One solution is to delay including GNU header files until the system
files have all been included --- But I used autoconf's AC_CONST
directive to conditionally add -Dconst= to DEFS.  I think this is the
better fix.

Enclosed is a patch which fixes regex.h to not define const, adds
AC_CONST to configure.in, and updates Makefile.in to document the
currenly used defines (-DNO_VFPRINTF -> -DHAVE_VPRINTF, etc.)

diff -c gnu/sed/Makefile.in:1.1.1.1 gnu/sed/Makefile.in:1.2
*** gnu/sed/Makefile.in:1.1.1.1	Wed Oct 14 13:11:36 1992
--- gnu/sed/Makefile.in	Wed Oct 14 13:11:36 1992
***************
*** 32,40 ****
  # -DSTDC_HEADERS	If you have ANSI C headers and libraries.
  # -DUSG			If you have System V/ANSI C string
  #			and memory functions and headers.
! # -D__CHAR_UNSIGNED__	If type `char' is unsigned.
! #			gcc defines this automatically.
! # -DNO_VFPRINTF		If you lack vprintf function (but have _doprnt).

  DEFS = @DEFS@
  LIBS = @LIBS@
--- 32,39 ----
  # -DSTDC_HEADERS	If you have ANSI C headers and libraries.
  # -DUSG			If you have System V/ANSI C string
  #			and memory functions and headers.
! # -DHAVE_VPRINTF	If you have the vprintf function.
! # -DHAVE_DOPRNT		If you have the _doprnt function.

  DEFS = @DEFS@
  LIBS = @LIBS@
diff -c gnu/sed/configure.in:1.1.1.1 gnu/sed/configure.in:1.2
*** gnu/sed/configure.in:1.1.1.1	Wed Oct 14 13:11:38 1992
--- gnu/sed/configure.in	Wed Oct 14 13:11:38 1992
***************
*** 9,12 ****
--- 9,13 ----
  AC_USG
  AC_VPRINTF
  AC_ALLOCA
+ AC_CONST
  AC_OUTPUT(Makefile)
diff -c gnu/sed/regex.h:1.1.1.1 gnu/sed/regex.h:1.2
*** gnu/sed/regex.h:1.1.1.1	Wed Oct 14 13:11:38 1992
--- gnu/sed/regex.h	Wed Oct 14 13:11:38 1992
***************
*** 376,390 ****
     prototype (if we are ANSI), and once without (if we aren't) -- we
     use the following macro to declare argument types.  This
     unfortunately clutters up the declarations a bit, but I think it's
!    worth it.

-    We also have to undo `const' if we are not ANSI.  */
-
  #if __STDC__
  #define _RE_ARGS(args) args
  #else
  #define _RE_ARGS(args) ()
- #define const
  #endif

  /* Sets the current default syntax to SYNTAX, and return the old syntax.
--- 376,387 ----
     prototype (if we are ANSI), and once without (if we aren't) -- we
     use the following macro to declare argument types.  This
     unfortunately clutters up the declarations a bit, but I think it's
!    worth it. */

  #if __STDC__
  #define _RE_ARGS(args) args
  #else
  #define _RE_ARGS(args) ()
  #endif

  /* Sets the current default syntax to SYNTAX, and return the old syntax.



Newsgroups: gnu.utils.bug