public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Error: must operate on two scalar (not array) subexpressions
@ 2002-05-14  5:13 Andrew Stone
  2002-05-14  7:03 ` Hassan Aurag
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Stone @ 2002-05-14  5:13 UTC (permalink / raw)
  To: gcc-help

Thanks Hassan and Toon,

Here's some more info:
G77 Version: g77 version 2.95.2 19991024 (release) (from FSF-g77 version
0.5.25 19991024 (release))

I have tried all the -fugly options to no avail, but from the previous
comment I found
the IMPLICIT INTEGER*4 (A-Z) statements.  I was trying not to do too much
code change,
but since the -fugly compiler options aren't the solution..I guess the code
changes will
have to be done - correct?

Again, thanks for your help,
andy

Andrew Stone
XML Architect/Developer
BrightLane, a TeamStaff Inc. Company
Office: 678-385-2823

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: must operate on two scalar (not array) subexpressions
  2002-05-14  5:13 Error: must operate on two scalar (not array) subexpressions Andrew Stone
@ 2002-05-14  7:03 ` Hassan Aurag
  0 siblings, 0 replies; 5+ messages in thread
From: Hassan Aurag @ 2002-05-14  7:03 UTC (permalink / raw)
  To: Andrew Stone; +Cc: gcc-help

I know this from experience. I got to port code written in Fortran ages
ago using g77 on linux/pc.


There is no fugly- that will let you compare chars to ints. Even IBM's
xlf does not support it. 

It should not however be hard to write an implicit function that does
it. Will take a char*something and int*same thing and do the magic of
equivalence locally to check if they are equal.





On Tue, 2002-05-14 at 08:13, Andrew Stone wrote:
> Thanks Hassan and Toon,
> 
> Here's some more info:
> G77 Version: g77 version 2.95.2 19991024 (release) (from FSF-g77 version
> 0.5.25 19991024 (release))
> 
> I have tried all the -fugly options to no avail, but from the previous
> comment I found
> the IMPLICIT INTEGER*4 (A-Z) statements.  I was trying not to do too much
> code change,
> but since the -fugly compiler options aren't the solution..I guess the code
> changes will
> have to be done - correct?
> 
> Again, thanks for your help,
> andy
> 
> Andrew Stone
> XML Architect/Developer
> BrightLane, a TeamStaff Inc. Company
> Office: 678-385-2823


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: must operate on two scalar (not array) subexpressions
  2002-05-13 11:31 Andrew Stone
  2002-05-13 11:44 ` Hassan Aurag
@ 2002-05-13 15:26 ` Toon Moene
  1 sibling, 0 replies; 5+ messages in thread
From: Toon Moene @ 2002-05-13 15:26 UTC (permalink / raw)
  To: Andrew Stone; +Cc: gcc-help

Andrew Stone wrote:

> I'm trying
> to compile this source code using g77 and get the following error:
> 
> CALC401K.FOR:194:
>          IF(UNTYPE.EQ.'XX  ') GOTO 171
>                   1   2
> Equality operator at (1) must operate on two scalar (not array)
> subexpressions, two function invocations returning arithmetic or character
> scalars, or a combination of both -- but the subexpression at (2) is an
> array

Are you sure you tried all compiler options starting with -fugly- .... ?

BTW, which version of the compiler are you using (send the output of g77
-v).

Thanks,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error: must operate on two scalar (not array) subexpressions
  2002-05-13 11:31 Andrew Stone
@ 2002-05-13 11:44 ` Hassan Aurag
  2002-05-13 15:26 ` Toon Moene
  1 sibling, 0 replies; 5+ messages in thread
From: Hassan Aurag @ 2002-05-13 11:44 UTC (permalink / raw)
  To: Andrew Stone; +Cc: gcc-help

Hi,

I guess UNTYPE is an integer*4, right?

In this case, there is no way you can compare it to a character*4,
unless you are on some very old machines with some very proprietary
compilers ;-)

The solution is:

integer*4 what1
character*4 what2 

equivalence (what1, what2)

what2 = 'XX  '

if (untype .eq. what1) .....



On Mon, 2002-05-13 at 14:30, Andrew Stone wrote:
> Hello all,
> 
> First off, I hope I'm in the right place.  I'm working on a project
> to put a DOS based system on the web. This system was written in
> FORTRAN-77 (not by me) and compiled with Salford's FTN77. I'm trying
> to compile this source code using g77 and get the following error:
> 
> CALC401K.FOR:194:
>          IF(UNTYPE.EQ.'XX  ') GOTO 171
>                   1   2
> Equality operator at (1) must operate on two scalar (not array)
> subexpressions, two function invocations returning arithmetic or character
> scalars, or a combination of both -- but the subexpression at (2) is an
> array
> 
> UNTYPE is Declared as:
> 
> COMMON/UNTYPE/UNTYPE
> 
> 
> Any help would be greatly appreciated, I've tried different compiler
> options and have not had any luck.
> 
> thanks in advance,
> andy
> 
> 
> Andrew Stone
> XML Architect/Developer
> BrightLane, a TeamStaff Inc. Company
> Office: 678-385-2823
> 
> Andrew Stone
> XML Architect/Developer
> BrightLane, a TeamStaff Inc. Company
> Office: 678-385-2823


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Error: must operate on two scalar (not array) subexpressions
@ 2002-05-13 11:31 Andrew Stone
  2002-05-13 11:44 ` Hassan Aurag
  2002-05-13 15:26 ` Toon Moene
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Stone @ 2002-05-13 11:31 UTC (permalink / raw)
  To: gcc-help

Hello all,

First off, I hope I'm in the right place.  I'm working on a project
to put a DOS based system on the web. This system was written in
FORTRAN-77 (not by me) and compiled with Salford's FTN77. I'm trying
to compile this source code using g77 and get the following error:

CALC401K.FOR:194:
         IF(UNTYPE.EQ.'XX  ') GOTO 171
                  1   2
Equality operator at (1) must operate on two scalar (not array)
subexpressions, two function invocations returning arithmetic or character
scalars, or a combination of both -- but the subexpression at (2) is an
array

UNTYPE is Declared as:

COMMON/UNTYPE/UNTYPE


Any help would be greatly appreciated, I've tried different compiler
options and have not had any luck.

thanks in advance,
andy


Andrew Stone
XML Architect/Developer
BrightLane, a TeamStaff Inc. Company
Office: 678-385-2823

Andrew Stone
XML Architect/Developer
BrightLane, a TeamStaff Inc. Company
Office: 678-385-2823

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-05-14 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-14  5:13 Error: must operate on two scalar (not array) subexpressions Andrew Stone
2002-05-14  7:03 ` Hassan Aurag
  -- strict thread matches above, loose matches on Subject: below --
2002-05-13 11:31 Andrew Stone
2002-05-13 11:44 ` Hassan Aurag
2002-05-13 15:26 ` Toon Moene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).