www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000378

When Created: 09/20/2005 05:39:56
Against DJGPP version: 2.03
By whom: ghost63@katamail.com
Abstract: Impossible to build grx246 with gcc 4.01 (djgpp 2.03)
I installed the last official (not alpha nor beta) version of djgpp (2.03 with gcc 4.01) in c:\djgpp (my O.S. is Windows XP SP2), then I installed grx246 under c:\djgpp and followed the instructions contained in grx246\readme.

The first make gave the following errors:
In file included from fdrivers/pblitr2r.c:44:
./fdrivers/pblit_nb.h: In function '_GrFrDrvPackedBitBltR2R':
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:100: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:101: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:102: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:103: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:114: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:115: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment
./fdrivers/pblit_nb.h:116: error: invalid lvalue in assignment

As suggested in makedefs.grx, I uncommented the line #CCOPT += -DNO_LEFTSIDE_LVALUE_CAST. The resulting make errors are the following:
In file included from c:/djgpp/include/go32.h:48,
                 from bgi/palette.c:43:
c:/djgpp/include/sys/segments.h: In function '__gr_setpalette':
c:/djgpp/include/sys/segments.h:19: error: invalid storage class for function '_my_cs'
c:/djgpp/include/sys/segments.h:27: error: invalid storage class for function '_my_ds'
c:/djgpp/include/sys/segments.h:35: error: invalid storage class for function '_my_ss'
bgi/palette.c:65: warning: implicit declaration of function '_go32_dpmi_simulate_int'
make.exe: *** [bgi/palette.o] Error 1

The same thing happened when I uncommented the line #CCOPT += -DNO_LEFTSIDE_PTR_CAST of makedefs.grx.

Is there something wrong with the new release of djgpp/gcc? I remember grx246 was fine with djgpp old versions.

Regards

Workaround added: 09/22/2005 16:37:02
By whom: ghost63@katamail.com
As already suggested here, I changed libgrx.h as follows:

/* Casting a lvalue on the left side of an assignment 
** causes error or warnings on several compilers:
**
** LCC v4.0
** Watcom C++ v11.0
** SUN cc v4.0
*/
#if !defined(NO_LEFTSIDE_LVALUE_CAST) &&                  \
    (   defined(__LCC__)                                  \
     || defined(__WATCOMC__)                              \
     || defined(__DJGPP__)                                \
     || defined(__SUNPRO_C)                               )
#define NO_LEFTSIDE_LVALUE_CAST
#endif

The added line is the one with "defined(__DJGPP__)".

Moreover, I changed palette.c as follows:

void __gr_setpalette(int colornum, int color)
{
#ifdef __DJGPP__
# include <dpmi.h>
//# include <go32.h>
  _go32_dpmi_registers regs;

  _DO_INIT_CHECK;


The "# include <go32.h>" has been commented.

This way the compilation of libgrx20.a works.

Note added: 04/26/2007 14:14:56
By whom: beale@best.com
The bug in grx246 causing it not to compile with the current DJGPP
distribution as of April 26 2007 (gcc 4.1.2) as reported here:
http://www.delorie.com/djgpp/bugs/show.cgi?000378
still exists. I made the two edits suggested there, to the two files

.../grx246/src/include/libgrx.h  [ add "|| defined(__DJGPP__) \"  ]
.../grx246/src/bgi/palette.c     [ comment //# include <go32.h>"  ]

and it did compile ok.
Can we get those edits incorporated and release a grx247 ?

Solution added: 06/02/2007 13:36:35
By whom: Maurice.Lombardi@ujf-grenoble.fr
This has been corrected in grx247

Maurice



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010