Subject: Re: B17: Compiler-Error
From: [email-masked] (David Coe)

11 Dec 1996 00:22:05 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0Gold (WinNT; I)
Original-To: Max Gotlib <[email-masked]>
Original-CC: [email-masked], [email-masked]
Original-Sender: [email-masked]

Max Gotlib wrote:
> 
>         It seems to me that compiler chosed non-proper string.h header file (it uses
> one designed for C and not for C++).
>         May be somebody will fix this bug, or point out how to withdraw with
> it (i'm afraid that it will not be usable to type
>   "c:/cygnus/include/.../string.h"
> instead of
>   <string.h>).
> 

I don't think the problem is in the function definition via compiler
choice of the c string.h or g++ String.h header. The construct:

        strch ( cwd, '\0' )[-1] != '/'

turns up in Groff both in libbib/index.cc and three times in grops/ps.cc
each time producing the "invalid types in int [int]" diagnostic. It
isn't a trick I'm familiar with, but if it means something like:

        cwd[ strch (cwd, '\0' ) - 1] != '/'

testing for a / at the end of the character string, then replacing the
four occurences by the second form gets Groff compiled and running (at
least so far -:). I can't find the first form of back-stepping a pointer
to a string inside a function in any of my "cookbooks". Is it legal?

Best wishes
-- 
Dr David Coe			     \=\
58 Fairlawn Drive, East Grinstead     \=\   Tel +44 1342 326860
West Sussex, RH19 1NT, United Kingdom  \=\  Fax +44 1342 316019
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".