Subject: [2.1.0] extras/FvwmScript fails on SunOS

From: [email-masked] (Paul D. Smith)
Date: 02 Nov 1998 14:43:24 -0500

This module has some issues:

 1) It uses the ANSI C runtime library div(), but SunOS doesn't provide
    one, nor its associated type div_t.  In about 90 seconds of looking
    around I didn't see anything that looked like an appropriate
    substitute.

    I suggest configure looks for the div() function and
    extras/FvwmScript/Instructions.c be modified to test HAVE_DIV and if
    it's not set, the RemainderOfDiv() function should just print an
    error message whenever invoked.

 2) Various functions in this module also use memmove(), which isn't
    available on SunOS either.

    I think this is another useful thing to add to libfvwm so that all
    modules can make use of standard C features without special code;
    a test for memmove() should be added to configure and maybe add
    something like this to libs/fvwmlib.h:

    #ifndef HAVE_MEMMOVE
    # define memmove(_t,_f,_n)  bcopy(_f,_t,_n)
    #endif

After this, I was able to get 2.1.0 (updated as of about two hours ago)
to build and install on SunOS with --enable-extras.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Austin Donnelly <[email-masked]>
Date: Tue, 3 Nov 1998 12:26:09 +0000

>     # define memmove(_t,_f,_n)  bcopy(_f,_t,_n)

Not quite right: bcopy() doesn't make any statements about what
happens if the memory areas overlap.  memmove() makes sure the right
thing happens.

Austin

---

From: [email-masked] (Paul D. Smith)
Date: 03 Nov 1998 11:41:50 -0500

%% Austin Donnelly <[email-masked]> writes:

  >> # define memmove(_t,_f,_n)  bcopy(_f,_t,_n)

  ad> Not quite right: bcopy() doesn't make any statements about what
  ad> happens if the memory areas overlap.  memmove() makes sure the right
  ad> thing happens.

Nope, this isn't correct.  The BSD versions (bcopy, bzero, bcmp) all
handle overlapping memory correctly (well, bzero doesn't care of course
:).

It's the ANSI functions that make a distinction between functions that
can be used with overlapping memory and ones that don't, thus you need
memmove() vs. memcpy().

To quote from the SunOS man pages ...

     bcopy() copies length bytes from string b1 to the string b2.  Overlap-
     ping strings are handled correctly.

---

From: Austin Donnelly <[email-masked]>
Date: Tue, 3 Nov 1998 17:32:59 +0000

>      ping strings are handled correctly.

Ok, I was looking at the HPUX manpages.   They make no mention about
what happens to overlapping strings.  Neither do the GNU manpages.

Austin