[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnubol: gcc compile error w/COBOL



Tim Josling wrote:
> 
> Matthew,
> 
> When building the compiler I follow the following procedure:
> 
> 0. I am running Red Hat linux 6.1 very standard
> 
> 1. Create the objdir and install directories. Then from objdir...
> 
> 2. configure --enable-languages=c,toy,exa,cobol
> --prefix=/home/tim/egcs_snaps/cob-egcs/install --disable-cpplib
> 
> 3. nice make bootstrap LANGUAGES=c
> (the above is because things don't work very well until the c
> compiler is built and building the other things - three times -
> is a waste of time at this stage)
> 
> 4. nice make install LANGUAGES="c cobol exe toy"
> (This builds the cobol etc once. You may need to install autogen
> from the cygnus site for this step, probably not)
> 
> 5. "Set the path to include the install/bin directory"
> 
> 6. run the tests from the objdir/gcc directory
> 
> make check-toy
> make check-exa
> make check-cobol
> 
> (requires various programs like 'expect' and tcl to be installed)
> 
> ...
> The make process is quite flakey IMO so I follow these steps
> religiously.
> 
> It looks from your error message that it is not finding the (I
> think) GCC intrinsic ATTRIBUTE_UNUSED which suppresses the unused
> error message for that parameter. Maybe your GCC is a little old.
> If this is a problem we can put in a conditional #define for it
> as follows:
> 
> #ifdef ???something???
> #define ATTRIBUTE_UNUSED /* nothing */
> #endif
> 

I'm using gcc 2.95.2, so it's pretty new.  Couple of problems.  Compile
fails pretty early on (first make), if you include RH's gcc java stuff. 
So far, I haven't gotten it to compile all the way. The
"ATTRIBUTE_UNUSED" in the function definition causes failure in all
cases, using either gansidecl or ansidecl.h.  I'm sure, however, if your
aim is to prevent those "Unused variable" warnings, a command line
switch may work as well.  Also, at least two headers which may have been
present in earlier (more primitive =P ) versions of gcc, are missing.
They are also dependencies in the makefile: tm_p.h and ggc.h.  I believe
that tm_p.h has been moved to tm.h.  The ggc.h, I dunno.  I don't see
anything like it.

Also, I'm getting a crapload of warnings of:
../../../gcc/cobol/../config/i386/i386.h:2758: warning: function
declaration isn't a prototype

They are all from i386.h, and happen for just about all the
declaraations in that file.  Again, doesn't matter which (g)ansidecl.h I
use.

Lastly, and possibly relating to the missing header files, I get the
following errors, for missing/undeclared items.  Can't find any of them
in any of the header files I have, either, or other source codes.


../../../gcc/cobol/cobcbei.c:695: `TI_MAX' undeclared here (not in a
function)
../../../gcc/cobol/cobcbei.c:726: `CTI_MAX' undeclared here (not in a
function)
../../../gcc/cobol/cobcbei.c: In function `init_decl_processing':
../../../gcc/cobol/cobcbei.c:1115: warning: implicit declaration of
function `build_common_tree_nodes'
../../../gcc/cobol/cobcbei.c:1132: `RID_BOUNDED' undeclared (first use
in this function)
../../../gcc/cobol/cobcbei.c:1132: (Each undeclared identifier is
reported only once
../../../gcc/cobol/cobcbei.c:1132: for each function it appears in.)
../../../gcc/cobol/cobcbei.c:1133: `RID_UNBOUNDED' undeclared (first use
in this function)
../../../gcc/cobol/cobcbei.c:1182: `widest_integer_literal_type_node'
undeclared (first use in this function)
../../../gcc/cobol/cobcbei.c:1183: `widest_unsigned_literal_type_node'
undeclared (first use in this function)
../../../gcc/cobol/cobcbei.c:1187: warning: implicit declaration of
function `build_common_tree_nodes_2'
../../../gcc/cobol/cobcbei.c: At top level:
../../../gcc/cobol/cobcbei.c:1323: warning: function declaration isn't a
prototype
../../../gcc/cobol/cobcbei.c:1333: warning: function declaration isn't a
prototype
make[2]: *** [cobcbei.o] Error 1
make[2]: Leaving directory
`/home/me2v/src/BUILD/gcc-2.95.2/objdir/gcc/cobol'
make[1]: *** [cobol/cobcc1] Error 2
make[1]: Leaving directory `/home/me2v/src/BUILD/gcc-2.95.2/objdir/gcc'
make: *** [install-gcc] Error 2


Which version of gcc did you write this for?  Maybe I should try that
one, depending on how hard it would be to get all this working for the
latest gcc's.  Although, eventually we'd need to bring it up to the
latest version, anyhow...


I've looked over Tiny COBOL's implementation of file i/o (a rather
cursory look, to be sure), and it looks fairly similar to what I had in
mind.  Cobol2c uses antlr, which is mildly archaic to me, but their
ideas were pretty similar to Tiny COBOL's and my own conception of how
it should work.  Haven't looked at cobcy's yet.  Anyhow, I'll start to
work on the parser additions, and try to get a white paper worked up
with my thoughts on the matter.  Be a little while, though, maybe a week
or so.

Lastly, regarding code reuse.  I personally don't mind poking around for
ideas and such, and reading other people's code to see how they did it. 
But I would rather the code be completely ours.  I'd rather not be
constrained by what someone else thought the license of their code
should be--better to be able to choose our own.  I'd personally prefer
something like the LGPL.  But then, that's just the way I feel. :)

Have a good weekend,
--
Matthew Vanecek
Visit my Website at http://mysite.directlink.net/linuxguy
For answers type: perl -e 'print
$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
*****************************************************************
For 93 million miles, there is nothing between the sun and my shadow
except me. I'm always getting in the way of something...

--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.