From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3BCA8EC6.8B8B40C9@strakt.com> From: Boyd Roberts MIME-Version: 1.0 To: 9fans@cse.psu.edu Subject: Re: [9fans] APE: strdup() References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 15 Oct 2001 09:22:46 +0200 Topicbox-Message-UUID: 08995af4-eaca-11e9-9e20-41e7f4b1d025 pac wrote: > > char *parameterfile, optarg; > ... > parameterfile = strdup(optarg); > > cc: incompatible types: "IND CHAR" and "INT" for op "AS" > although manpage says: > char* strdup(char *s) Yes, this is why I don't like declarations like that. You have declared a char * [parameterfile] and a char [optarg] which has be premoted to int when passed to strdup(). Before I shoot myself in the foot, I checked out getopt(3). You need to declare: extern char *optarg; I never commit to memory all this quirky stuff; I always use man.