Amanda-Users

Resolved: Compiling 2.4.4p1 with gcc on SunOs 4.1.3

2003-10-07 04:17:01
Subject: Resolved: Compiling 2.4.4p1 with gcc on SunOs 4.1.3
From: Julian C H Stevens <julian.stevens AT cfswebmail DOT com>
To: amanda-users AT amanda DOT org
Date: Tue, 7 Oct 2003 01:12:06 -0700 (PDT)
Thanks to Jon and Paul for putting me straight on this.

I put the missing declaration (extern int optind) into amanda.h, and everything 
compiles now.
(Sorry for the delay in replying but I had a few days off, not too far from 
Paul, in Ghent)

Julian

--- Jon LaBadie <jon AT jgcomp DOT com> wrote:
On Wed, Oct 01, 2003 at 07:06:00PM +0200, Paul Bijnens wrote:
> 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.)
> >>

...snip... 
> >
> >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.

Good to see the clarifications, thanks.

I guess Julian was the first to build on SunOS since the promotion :)

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)


_____________________________________________________________
Get Paid to Surf the Web!
http://www.alladvantage.com/home.asp?refid=AVZ855

<Prev in Thread] Current Thread [Next in Thread>
  • Resolved: Compiling 2.4.4p1 with gcc on SunOs 4.1.3, Julian C H Stevens <=