emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lossage from b... functions change


From: Dave Love
Subject: Re: lossage from b... functions change
Date: Thu, 29 May 2003 14:33:46 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux)

Richard Stallman <address@hidden> writes:

> I can't access the repository from here.  Can you show me the change,
> and the change log entry?  With that, I can search my old mail
> to see why it was made.

I guess this was it.

2003-03-03  Rob Browning  <address@hidden>

        * configure.in: add AC_CHECK_FUNCS for memcmp and memmove.
        (AH_BOTTOM): switch tests to prefer memcmp, memset, and memmove
        over bzero, bcmp, and bcopy.

Index: configure.in
===================================================================
RCS file: /cvsroot/emacs/emacs/configure.in,v
retrieving revision 1.327
retrieving revision 1.328
diff -u -p -c -r1.327 -r1.328
cvs server: conflicting specifications of output style
*** configure.in        21 Feb 2003 08:07:29 -0000      1.327
--- configure.in        3 Mar 2003 18:29:42 -0000       1.328
*************** strerror fpathconf select mktime euidacc
*** 2209,2215 ****
  utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
  __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
  sendto recvfrom getsockopt setsockopt getsockname getpeername \
! gai_strerror mkstemp getline getdelim mremap memmove fsync bzero memset)
  
  AC_CHECK_HEADERS(sys/un.h)
  
--- 2209,2216 ----
  utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
  __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
  sendto recvfrom getsockopt setsockopt getsockname getpeername \
! gai_strerror mkstemp getline getdelim mremap memmove fsync bzero \
! memset memcmp memmove)
  
  AC_CHECK_HEADERS(sys/un.h)
  
*************** typedef unsigned size_t;
*** 2826,2839 ****
  #  endif
  #endif
  
! #ifndef HAVE_BCOPY
! #define bcopy(a,b,s) memcpy (b,a,s)
! #endif
! #ifndef HAVE_BZERO
! #define bzero(a,s) memset (a,0,s)
! #endif
! #ifndef HAVE_BCMP
! #define BCMP memcmp
  #endif
  
  #endif /* EMACS_CONFIG_H */
--- 2827,2842 ----
  #  endif
  #endif
  
! /* avoid deprecated functions */
! #ifdef HAVE_MEMCPY
! #  define bcopy(a,b,s) memcpy (b,a,s)
! #endif
! #ifdef HAVE_MEMSET
! #  define bzero(a,s) memset (a,0,s)
! #endif
! #ifdef HAVE_MEMCMP
! #  define BCMP memcmp
! #  define bcmp memcmp
  #endif
  
  #endif /* EMACS_CONFIG_H */

>                                             as I said before, mapping
>     bcopy to memcpy is dubious.
>
> I missed that.  What is the issue?

Here's the message.

--- Begin Message --- Subject: b... functions in configure.in Date: Sun, 18 May 2003 21:20:56 +0100 User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)
I don't understand the purpose of the following fragment in
configure.in, and I'm not convinced it's correct.

What's the point of defining bcopy away if you have it, especially at
the expense of confusion when debugging?  What about the case now
removed for the system not having bcopy or memmove?  (If that's
irrelevant now, stuff in sysdep.c can be cleaned up.)  Is it clear
that bcopy is never used with overlapping args, and what's to prevent
someone doing that in future?  If it's always used with
non-overlapping args and you want to outlaw it, I think it should just
be replaced globally with memcpy (which has the advantage of being
inlined by gcc) to avoid confusion.  What's BCMP for, which doesn't
seem to be used anywhere.

/* avoid deprecated functions */
#ifdef HAVE_MEMCPY
#  define bcopy(a,b,s) memcpy (b,a,s)
#endif
#ifdef HAVE_MEMSET
#  define bzero(a,s) memset (a,0,s)
#endif
#ifdef HAVE_MEMCMP
#  define BCMP memcmp
#  define bcmp memcmp
#endif

--- End Message ---
>       I previously cleaned up the
>     treatment of bcopy & al so that the configuration should have worked
>     generally.
>
> Which cleanup was that?  If you could show me the change log entry for
> that, it would help me understand the situation.  (The date is also
> relevant.)

I guess it was these, avoiding previous problems on solaris and irix
which required bcopy & al to be undefed explicitly.

2002-11-15  Dave Love  <address@hidden>

        * configure.in: Tidy up various quoting issues throughout.  Use
        AC_GNU_SOURCE.
        (AH_BOTTOM): Fix #endif protecting config.h.  Maybe include
        alloca.h.  Define GC_SETJMP_WORKS, GC_LISP_OBJECT_ALIGNMENT.
        Maybe define bcopy, bzero, bcmp.

2002-10-30  Dave Love  <address@hidden>

        * configure.in:  Require autoconf 2.53.  Test for pty.h,
        sys/mman.h, sys/param.h, mremap, memmove.
        (AH_BOTTOM): Maybe include strings.h.  Add local variables for
        mode.

along with changes in src/s at 2002-10-30.  The changes avoided having
to do anything special in the config files.  I noticed this change

2003-05-24  Andreas Schwab  <address@hidden>

        * configure.in (AH_BOTTOM) [MAC_OSX]: Do not redefine bcopy,
        bzero, and bcmp.

which implies there's a problem with more current systems than sunos4.
That's the sort of thing that I removed from the src/s files in the
cleanup above.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]