Well, the first instance of the problem is in the bit.cpp file. I didn't write the file originally, and I haven't made any modifications to it. The credits are from Jason Dinkel.

Anyway, the compile output is:

bit.cpp: In function 'char*' flag_string(const flag_type*, int)':
bit.cpp: Invalid conversion from 'const char*' to 'char*'

The function I have in the code (at least the one I think it's referring to) is:

char *flag_string( const struct flag_type *flag_table, int bits )
{
   static char buf[2][512];
   static int cnt = 0;
   int  flag;

   if ( ++cnt > 1 )
        cnt = 0;

   buf[cnt][0] = '\0';

   for (flag = 0; flag_table[flag].name != NULL; flag++)
   {
        if ( !is_stat( flag_table ) && IS_SET(bits, flag_table[flag].bit) )
        {
            strcat( buf[cnt], " " );
            strcat( buf[cnt], flag_table[flag].name );
        }
        else
        if ( flag_table[flag].bit == bits )
        {
            strcat( buf[cnt], " " );
            strcat( buf[cnt], flag_table[flag].name );
            break;
        }
   }
   return (buf[cnt][0] != '\0') ? buf[cnt]+1 : "none";
}

Now, since I didn't write the function, I'm not totally sure what to fix...It's always compiled and run fine on my MSVC 6, so I'm somewhat at a loss, not being a terribly experience programmer.

So, if you have any idea of what I need to change, it'd be greatly appreciated.

Cheers,
UD




From: Tiikuli <[EMAIL PROTECTED]>
To: Matthew Martin <[EMAIL PROTECTED]>
CC: [email protected]
Subject: Re: Linux problems
Date: Wed, 12 Mar 2003 18:58:27 +0200 (EET)

> Hey all, new to the group, though I've been using rom for several years now.
>
> I had a question I was hoping someone could help me out with regarding Linux
> compiling. I recently built and installed my new Linux machine, and I've
> been running a windows ported Rom2.4b source for several months. I wanted to > transfer it over to the Linux box and compile. I copied all of the source > files over, and modified the makefile to reflect any new files I was making. > (Basically, I followed the directions on the Rom website). However, I seem
> to keep getting compiler errors for the same message: invalid conversion
> from const char to *char. Was wondering if this is a known compiler bug, or
> perhaps a problem with a version, or something.

It's not a bug in compiler, nor version problem.  That error basically
tells you that the code has some 'bad practice' which may or may not cause
you trouble someday:  conversion from a constant data pointer to
something 'non-constant' is no more (and never should have been) allowed
by default without forcing typecast (IMHO it shouldn't be allowed at all
in any case).  What you can do, is to find the sections of code which make
that error to arise and force a (char*) typecast.

---
DK


--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


Reply via email to