HylaFAX The world's most advanced open source fax server

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

Re: [hylafax-users] compiling error for 5.1.11



Lee Howard typed (on Mon, Nov 19, 2007 at 09:48:15AM -0800):
> Jean-Pierre Radley wrote:
>
>> Lee Howard typed (on Sun, Nov 18, 2007 at 07:43:00PM -0800):
>>  
>>> Jean-Pierre Radley wrote:
>>>
>>>    
>>>> I had zero problems compiling 5.1.10 on SCO OSR 6.0.0, but 5.1.11 barfs:
>>>>
>>>> /bin/CC -D__ANSI_CPP__ -I. -I..  -I.././regex -I.././util -I.././util -I/usr/local/include -O  -c InetTransport.c++
>>>> "InetTransport.c++", line 153: error: a value of type "const char *" cannot be
>>>> used to initialize an entity of type "char *"
>>>>      char *cp = strchr(client.getLastResponse(), '(');
>>>>      
>>> My 'man strchr' says that it returns (char *) and not (const char *).  
>>> What does yours say?
>>>    
>>
>> It returns (char *), but the first argument is (const char *):
>>
>> 	char  * strchr(const char  * s, int c)
>>  
>
> Well, getLastResponse() returns (const fxStr&), and so I would think that 
> it should be able to convert that to (const char*) without a hitch.  You're 
> welcome to try:
>
> char *cp = strchr((const char*) client.getLastResponse(), '(');
>
> ... but my guess is that it will do no good.  We're probably dealing with 
> another one of those cases where SCO likes to have a more relaxed 
> initialization approach, and if that's the case, then this may work:
>
> --- util/InetTransport.c++.orig 2007-11-19 09:29:31.702201768 -0800
> +++ util/InetTransport.c++      2007-11-19 09:30:03.754329104 -0800
> @@ -150,7 +150,8 @@
>     if (client.isPassive()) {
>        if (client.command("PASV") != FaxClient::COMPLETE)
>            return (false);
> -       char *cp = strchr(client.getLastResponse(), '(');
> +       char *cp;
> +       cp  = strchr(client.getLastResponse(), '(');
>        if (!cp) return (false);
>        cp++;
>        unsigned int v[6];

Neither of your suggestions work. Charles Duffy wrote:

> Hmm -- seems you've got a stricter C++ compiler than most. Does
> putting the obvious cast in place help? ie.
>
>        char *cp = (char*)strchr(client.getLastResponse(), '(');

That change does enable me to compile all the binaries.
Maybe my man page is innaccurate?

But: I installed those 5.1.11 binaries on my machine and on a customer's
machine, and my customer's machine cannot send me a fax:

	faxstat -s on the sender complains about "No receiver protocol".
	xferlog on the receiver complains about "No sender protocol".

-- 
JP


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions