public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: gFortran problem compiling complex character strings
@ 2007-12-15 16:10 Dominique Dhumieres
  2007-12-15 16:17 ` John (Eljay) Love-Jensen
  2007-12-15 16:36 ` Colin Tuckley
  0 siblings, 2 replies; 9+ messages in thread
From: Dominique Dhumieres @ 2007-12-15 16:10 UTC (permalink / raw)
  To: gcc-help; +Cc: colin

>            print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"'

Colin, your line is too long for the fixed form implied by the .f suffix:
the last ' is at column 73 and not considered by gfortran as part of the statement.
You can break your line, used the free form (implied by .f90) or remove some
spaces at the beginning of the line.

Good luck!

Dominique

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

* RE: gFortran problem compiling complex character strings
  2007-12-15 16:10 gFortran problem compiling complex character strings Dominique Dhumieres
@ 2007-12-15 16:17 ` John (Eljay) Love-Jensen
  2007-12-15 16:36 ` Colin Tuckley
  1 sibling, 0 replies; 9+ messages in thread
From: John (Eljay) Love-Jensen @ 2007-12-15 16:17 UTC (permalink / raw)
  To: Dominique Dhumieres, gcc-help; +Cc: colin

> print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"'

> Colin, your line is too long for the fixed form implied by the .f suffix:
the last ' is at column 73 and not considered by gfortran as part of the statement.
You can break your line, used the free form (implied by .f90) or remove some
spaces at the beginning of the line.

Good eye, Dominique!

Rant on the subject...
http://www.rolandli.com/?p=34

--Eljay

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

* Re: gFortran problem compiling complex character strings
  2007-12-15 16:10 gFortran problem compiling complex character strings Dominique Dhumieres
  2007-12-15 16:17 ` John (Eljay) Love-Jensen
@ 2007-12-15 16:36 ` Colin Tuckley
  2007-12-17 14:09   ` Atwood, Robert C
  1 sibling, 1 reply; 9+ messages in thread
From: Colin Tuckley @ 2007-12-15 16:36 UTC (permalink / raw)
  Cc: gcc-help

Dominique Dhumieres wrote:
>>            print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"'
> 
> Colin, your line is too long for the fixed form implied by the .f suffix:
> the last ' is at column 73 and not considered by gfortran as part of the statement.
> You can break your line, used the free form (implied by .f90) or remove some
> spaces at the beginning of the line.

Argh! Yes, of course. It must be that g77 didn't have that limit since the
program used to build ok with that. I will snip a space out from somewhere.

regards,

Colin

-- 
Colin Tuckley      |  +44(0)1903 236872  |  PGP/GnuPG Key Id
Debian Developer   |  +44(0)7799 143369  |     0x1B3045CE

Artificial Intelligence is no match for natural stupidity.

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

* RE: gFortran problem compiling complex character strings
  2007-12-15 16:36 ` Colin Tuckley
@ 2007-12-17 14:09   ` Atwood, Robert C
  2007-12-17 14:15     ` John Love-Jensen
  0 siblings, 1 reply; 9+ messages in thread
From: Atwood, Robert C @ 2007-12-17 14:09 UTC (permalink / raw)
  To: gcc-help

dominique> > Colin, your line is too long for the fixed form implied by 
dominique> the .f suffix:

colin> Argh! Yes, of course. It must be that g77 didn't have that 
colin> limit since the
colin> program used to build ok with that.

Now I am curious why that would be, I was under the impression that (in
absence of any flags) the 72 char  was the default in g77? 
Did you have a Makefile or other build system that had some additional
flags when using g77?  
(I am in the positon of helping Fortran users get their programs working
without actually being a Fortran user so little bits of info like this
are useful!)


 man g77 says:
       -ffixed-line-length-n
           Set column after which characters are ignored in typical
fixed-form lines in the source file, and through which spaces are
           assumed (as if padded to that length) after the ends of short
fixed-form lines.
           Popular values for n include 72 (the standard and the
default), 80 (card image), and 132 ...
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


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

* Re: gFortran problem compiling complex character strings
  2007-12-17 14:09   ` Atwood, Robert C
@ 2007-12-17 14:15     ` John Love-Jensen
  2007-12-17 14:34       ` Atwood, Robert C
  0 siblings, 1 reply; 9+ messages in thread
From: John Love-Jensen @ 2007-12-17 14:15 UTC (permalink / raw)
  To: Atwood, Robert C, MSX to GCC

Hi Robert,

> Now I am curious why that would be, I was under the impression that (in
> absence of any flags) the 72 char  was the default in g77?

Since his line was 73 characters long, it was one character too long for the
72 character default.

--Eljay

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

* RE: gFortran problem compiling complex character strings
  2007-12-17 14:15     ` John Love-Jensen
@ 2007-12-17 14:34       ` Atwood, Robert C
  2007-12-17 15:05         ` Colin Tuckley
  0 siblings, 1 reply; 9+ messages in thread
From: Atwood, Robert C @ 2007-12-17 14:34 UTC (permalink / raw)
  To: John Love-Jensen; +Cc: gcc-help

Hi, Eljay:

> Since his line was 73 characters long, it was one character 
> too long for the
> 72 character default.

Sorry , I was unclear, what I meant was: why DIDN'T it fail to compile
in g77? 
(i.e. why did it work for Colin previously?) 

Unless some flags were used that were not mentioned in the original
post, shoudn't the 73-character line fail just as much whether it's
compiled with  g77 or gfortran, because of that same punchcard-style
statement requirement?

Thanks
Robert




 

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

* Re: gFortran problem compiling complex character strings
  2007-12-17 14:34       ` Atwood, Robert C
@ 2007-12-17 15:05         ` Colin Tuckley
  2007-12-17 15:29           ` Atwood, Robert C
  0 siblings, 1 reply; 9+ messages in thread
From: Colin Tuckley @ 2007-12-17 15:05 UTC (permalink / raw)
  To: Atwood, Robert C; +Cc: John Love-Jensen, gcc-help

Atwood, Robert C wrote:

> Sorry , I was unclear, what I meant was: why DIDN'T it fail to compile
> in g77? 
> (i.e. why did it work for Colin previously?)

Yes, that was my main question too. Note that I am NOT the author or
maintainer of this package. I've just been tasked with converting it to use
gfortran.

> Unless some flags were used that were not mentioned in the original
> post, shoudn't the 73-character line fail just as much whether it's
> compiled with  g77 or gfortran, because of that same punchcard-style
> statement requirement?

I've checked the makefile and the log, the actual command was as stated:

gfortran -g -O2 -c fortestF.f

Attempting to build the original package on my x86 system it does:

g77 -g -O2 -c fortestF.f

which builds ok.

So it would appear that the Debian version of g77 does not have the 72 char
limit.

regards,

Colin

-- 
Colin Tuckley      |  +44(0)1903 236872  |  PGP/GnuPG Key Id
Debian Developer   |  +44(0)7799 143369  |     0x1B3045CE

Try to learn from other people's mistakes, you haven't time to make them all
yourself! - Anon

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

* RE: gFortran problem compiling complex character strings
  2007-12-17 15:05         ` Colin Tuckley
@ 2007-12-17 15:29           ` Atwood, Robert C
  0 siblings, 0 replies; 9+ messages in thread
From: Atwood, Robert C @ 2007-12-17 15:29 UTC (permalink / raw)
  To: Colin Tuckley; +Cc: John Love-Jensen, gcc-help

colin> So it would appear that the Debian version of g77 does not 
colin> have the 72 char
colin> limit.

Indeed, I cannot reproduce that on this Suse-10 system, if it fails wth
gfortran, and it also fails with g77. I copied your print statement,
with print starting in column 12, thus the closing single-quote is in
73, then just an 'end' after for a 2-line program 

      1            print *, 'Try one of "Skip", "Test", "Verbosity" or
"Cleanup"'
      2       end


Both g77 and gfortran choke on it when not using any -ffree-form or
-ffixed-line-length= flags, and work if using the flag.

 Did debain patch it so that it does not behave as documented? are the
documents patched too?!? I've got debian (lenny/sid) at home I can try
later on -- but probably I'm not going to be doing any fortran on that
machine. 

(Also the editor I'm using (vim) handily places a nasty-looking yellow
blob over the offending quote when it's beyond the 72 columns!)

Versions:

GNU Fortran (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
GNU Fortran 95 (GCC 4.0.2 20050901 (prerelease) (SUSE Linux))
GNU Fortran 95 (GCC) 4.2.0 20070130 (prerelease) <- my own build 

Robert

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

* gFortran problem compiling complex character strings
@ 2007-12-14  8:53 Colin Tuckley
  0 siblings, 0 replies; 9+ messages in thread
From: Colin Tuckley @ 2007-12-14  8:53 UTC (permalink / raw)
  To: gcc-help

I'm currently trying to build libhdf4 on armel with gfortran.

colin@muscat:~$ gfortran --version
GNU Fortran (GCC) 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)


One of the test programs contains the statement:

 print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"'

which fails to compile giving:

gfortran -g -O2 -c fortestF.f
fortestF.f:193.20:

           print *, 'Try one of "Skip", "Test", "Verbosity" or "Cleanup"
                   1
Error: Unterminated character constant beginning at (1)


If I remove the double quote characters from inside the string then it
compiles ok.

Is this a compiler error/problem? A configuration problem? or something else?

regards,

Colin

--
Colin Tuckley      |  +44(0)1903 236872  |  PGP/GnuPG Key Id
Debian Developer   |  +44(0)7799 143369  |     0x1B3045CE

"Energize!" said Picard and the pink bunny appeared...

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

end of thread, other threads:[~2007-12-17 15:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-15 16:10 gFortran problem compiling complex character strings Dominique Dhumieres
2007-12-15 16:17 ` John (Eljay) Love-Jensen
2007-12-15 16:36 ` Colin Tuckley
2007-12-17 14:09   ` Atwood, Robert C
2007-12-17 14:15     ` John Love-Jensen
2007-12-17 14:34       ` Atwood, Robert C
2007-12-17 15:05         ` Colin Tuckley
2007-12-17 15:29           ` Atwood, Robert C
  -- strict thread matches above, loose matches on Subject: below --
2007-12-14  8:53 Colin Tuckley

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