[Prev][Next][Index]
bug report
- From: Jose Moreira <moreira@watson.ibm.com>
- Subject: bug report
- To: sage-bugs@extreme.indiana.edu
- Date: Tue, 11 Jun 1996 14:10:59 -0400 (EDT)
- Sender: owner-sage-bugs@extreme.indiana.edu
We found a bug in Sage++ when it is unparsing "namelist"
statements (Fortran 90). This bug is in the critical path
of a release of our programming environment, and we would
appreciate it if someone could take a look as soon as possible.
If there is already a fix available, please let us know. If
there is nobody available to look into this, could you please
direct us to the places in the source code where we can
try to find the problem and fix ourselves?
Thanks - Jose Moreira
>>>>>>>>>>>>> Bug description <<<<<<<<<<<<<<
When we compile the following program with f2dep:
------------------------------------------------------
PROGRAM main
integer h, g
namelist /parms/ h, g
END
-----------------------------------------------------
and unparse it, we obtain
-----------------------------------------------------
program main
integer h,g
namelist /parms/,g
end
----------------------------------------------------
As you can see, there in no indentation for the namelist command,
and the first variable has disappeared. The C++ program we
used to unparse is:
----------------------------------------------------
/*********************************************************************/
/* pC++/Sage++ Copyright (C) 1993 */
/* Indiana University University of Oregon University of Rennes */
/*********************************************************************/
#include <stdio.h>
#include <malloc.h>
#include <iostream.h>
#include "sage++user.h"
void processFile(
SgFile* file
) {
file->unparsestdout();
}
int main(
int argc,
char** argv
) {
/*
* Open the project.
*/
if (argc != 2) {
cout << "usage: unparse <project name>" << endl;
return -1;
}
SgProject project(argv[1]);
for (int i = 0; i < project.numberOfFiles(); i++) {
SgFile* file = &project.file(i);
switch (file->languageType()) {
case CSrc:
cout << "Must be a FORTRAN file \n";
return -1;
case ForSrc:
processFile(file);
break;
}
}
return 0;
}
---------------------------------------------------------------------