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

Re: OT: X2C library problems



On Wed, 8 Aug 2001, Richard Kettlewell wrote:

> Dale Scheetz writes:
> > I've been trying to build a working version of the X2C compiler, and while
> > the compiler itself was pretty easy to fix so it would build, the
> > libraries are a bit more of a challenge.
> > 
> > There is no LINUX target for the build, so I'm using the XNX (Xenix)
> > target and trying to find the correct set of parameters for gcc.
> > 
> > The current set I'm attempting to build with are:
> > 
> >       CCPARMS="-msoft-float -traditional -ansi -funsigned-char"
> >       CC=gcc
> > 
> >       PARMS=" $CCMODE $CCPARMS  \
> >               -DNO_PROTOTYPE -DUNIX  -DCURSES  -DM_TERMINFO -DHAS_ANY
> 
> From gcc.info:

'ts what I get for reading man pages ;-)

Is there an alternative to info, for a tool to read these pages. I find
the info browser almost impossible to use. I'm always getting stuck on a
branch where I can't seem to get back to where I started from.

> 
>     GCC also has some limited support for traditional (pre-ISO) C with
>     the `-traditional' option.  This support may be of use for
>     compiling some very old programs that have not been updated to ISO
>     C, but should not be used for new programs.  It will not work with
>     some modern C libraries such as the GNU C library.
> 
> [...]
> 
>     You cannot use `-traditional' if you include any header files that
>     rely on ANSI C features.  Some vendors are starting to ship
>     systems with ANSI C header files and you cannot use `-traditional'
>     on such systems to compile files that include any system headers.
> 
> > Obviously I'm an idiot. So what's the simple solution to my problem?
> 
> I suspect you'll have to port the program to modern C.  I'd start by
> losing "-traditional -ansi" and seeing where the compiler stops first.

When I loose these options I have a different problem with the same code.
See below for details.
> 
> I'm not sure why you think you need the -msoft-float option, reading
> the documentation for it seems to imply that it won't even work
> without getting some additional libraries.  (But you may have some
> reason for using it that I'm not aware of.)
> 
Cruft from the XNX target. I've been working with the parameters and the
process of elimination. Having some idea of what's going on is a lot
better way to weed out the useless options ;-)

Now that I have a reasonable set of options, I'm back to a problem with
the redefinition of WINDOW. For some reason the redefinition (which is the
correct struct for the code, rather than the curses defined WINDOW) does
not take effect, and the compiler complains about an undefined element.
(defined in the inline def, but not in the curses version)

The new WINDOW is defined thus:

#undef  WINDOW
#define WINDOW  struct Xwin_st

This definition is the last step in the if-block that starts:

#if 0
#ifdef M_TERMCAP
#define chtype short

#ifndef __GNUC__
        /* Copied from /usr/include/tcap.h */
struct Xwin_st {
        short           _cury, _curx;
        short           _maxy, _maxx;
        short           _begy, _begx;
        short           _flags;
        short           _FIXIT; /* Add extra 2 bytes for alignment */
        bool            _clear;
        bool            _leave;
        bool            _scroll;
        bool            _keypad;                        /* Sys V Release 2
*/
        short           **_y;
        short           *_ybase;
        short           *_firstch;
        short           *_lastch;
        struct _win_st  *_nextp, *_orig;
};

This is all contained within another if-block that starts:

#ifndef M_XENIX

Aside from tracking down M_XENIX and M_TERMCAP, I've never understood what
triggers '#if 0', so there are several reasons why this code definition is
not in place.

Additional errors like:

Compiling dbflock.c
Source dbflock.c.e (rc=1)
In file included from
/home/dwarf/projects/CB1/libs/build/include/dbx.h:653,
                 from dbflock.c:11:
/home/dwarf/projects/CB1/libs/build/include/any.hf:8: warning: conflicting
types for built-in function `strcpy'
dbflock.c:186: parse error before `-'
dbflock.c:193: parse error before `{'
dbflock.c:198: initializer element is not constant
dbflock.c:198: warning: data definition has no type or storage class
dbflock.c:199: parse error before `->'
dbflock.c: In function `DQ_dlck':
dbflock.c:232: `CEILING' undeclared (first use in this function)
dbflock.c:232: (Each undeclared identifier is reported only once
dbflock.c:232: for each function it appears in.)
dbflock.c:239: `FLOOR' undeclared (first use in this function)
dbflock.c: In function `DXplock':
dbflock.c:283: `CEILING' undeclared (first use in this function)
dbflock.c: In function `DXhlock':
dbflock.c:329: `FLOOR' undeclared (first use in this function)

Make me think I don't have time to work through all of this...

Thanks for all the help,

Dwarf
--
_-_-_-_-_-   Author of "Dwarf's Guide to Debian GNU/Linux"  _-_-_-_-_-_-
_-                                                                    _-
_- aka   Dale Scheetz                   Phone:   1 (850) 656-9769     _-
_-       Flexible Software              11000 McCrackin Road          _-
_-       e-mail:  dwarf@polaris.net     Tallahassee, FL  32308        _-
_-                                                                    _-
_-_-_-_-_-  Released under the GNU Free Documentation License   _-_-_-_-
              available at: http://www.polaris.net/~dwarf/



Reply to: