Re: Passing Strings



Richard Maine <nospam@xxxxxxxxxxxxx> wrote:

I'd say another way was to submit bug reports. Looks like a compiler bug
to me. I'm not sure what icc is that it would have a bug in common with
gfortran. I see nothing obviously wrong with the code.

Um. Ignore that. I obviously need to get my coffee before reading clf
instead of afterwards. See Herman's correct answer. I well know about
that particular bug (in user code, *NOT* in the compilers) and have
explained it to plenty of people, but my mind is obviously not yet in
gear this morning.

What you declare the dummy argument with a length of 255, that means
exactly 255, not anything up to 255. If you pass a shorter actual
argument, that is a user error. Most commonly, this will result in the
dummy argument using whatever garbage happens to be in the subsequent
memory locations after the actual argument.

My advice on dummy character argumemts is to (almost) always declare
them with assumed length (the * form that Herman shows). The exceptions
are too rare to worry about - rare enough that I'm having trouble
recalling one at the moment. I suppose that in theory, you might get
compiler error checking from the explicit-length form, but I don't
recall ever seeing such error checking actually happen. I've seen the
explicit-length form cause errors plenty of times, so that doesn't seem
like a good tradeoff.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: [OT] Family names (Wieser)
    ... similar and common between them... ... "bug" was commonly used in electrical engineering (the term ... post-Roman periods...and, certainly, the old Celtic languages were ... sometimes think they were the "originals" on this small island, ...
    (alt.lang.asm)
  • Re: Code or compiler bug re: TRANSFER intrinsic?
    ... > of the fortran standard. ... compiler I tried had a bug relating to it somewhere. ... the other is what gets associated with the dummy argument. ...
    (comp.lang.fortran)
  • Re: Causing Death by Accident
    ... But the reason they are not so common is not ... The brain's reaction upon encountering a "bug" ... which analyses the bug and provides a patch. ... It still has to take us offline for a short while whilst it formulates ...
    (uk.legal)
  • Re: Code or compiler bug re: TRANSFER intrinsic?
    ... >>of the fortran standard. ... > compiler I tried had a bug relating to it somewhere. ... I only need the code for byteswapping a single 4-byte integer (and, occasionally, ... > the other is what gets associated with the dummy argument. ...
    (comp.lang.fortran)
  • Re: Change Event cant reference .text property
    ... Combobox doesn't send the focus to any other control. ... the error and Me.ActiveControl.Name returns the name Dummy, ... This is definately a bug. ...
    (microsoft.public.access.forms)