Amanda-Users

Re: Compiling 2.4.4p1 with gcc on SunOs 4.1.3

2003-10-01 13:10:03
Subject: Re: Compiling 2.4.4p1 with gcc on SunOs 4.1.3
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: amanda-users AT amanda DOT org
Date: Wed, 01 Oct 2003 19:06:00 +0200
Jon LaBadie wrote:

On Wed, Oct 01, 2003 at 06:28:07PM +0200, Paul Bijnens wrote:
Do "man 3 getopt" to get the page for the C library routines.

...
What I do not know exactly is why gcc doesn't complain on other
OSes about the missing declaration.  (in amanda.h I find the
definition for getopt and optarg, but not for optind; actually
you better add the definition there.)



Again, this is for Solaris, not SunOS;

Sun's man needs the -s option to see other sections and getopt is in 3c.
So the command would be "man -s 3c getopt".

$ uname -rs
SunOS 4.1.4
$ man -s 3c getopt
Usage:  man [-] [-t] [-M path] [-T tmac.an] [ section ] name ...
        man -k keyword ...
        man -f file ...

SunOS 4.1.x only recognizes "man 3 getopt"


It indicates that optind and the others are defined in <unistd.h>.
So possibly that should be included in your source somewhere (amanda.h?).

Yes, that indeed why on modern OSes gcc does not complain anymore.
I have only SunOS 4.1.4 in my Jurassic (S)Parc , and there is no
definition related to getopt in stdlib.h from SunOS 4.1.4

Both ammt.c and amdd.c have explicitly defined optind.  "tapetype.c"
was only an extra program before it became promoted to amtapetype.
That's probably why it was never tested that much on different OSes.


--
Paul Bijnens, Xplanation                            Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit,  ZZ, :q, :q!,  M-Z, ^X^C,  logoff, logout, close, bye,  /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* kill -9 1,  Alt-F4,  Ctrl-Alt-Del,  AltGr-NumLock,  Stop-A,  ...    *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************