Find the answer to your Linux question:
Results 1 to 4 of 4
Code: gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I/usr/X11R6/include -mtune=pentiumpro -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 -fno-strict-aliasing -ffast-math -funroll-loops ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028

    GCC4 lack of backward compatability?


    Code:
     gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I/usr/X11R6/include -mtune=pentiumpro -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 -fno-strict-aliasing -ffast-math -funroll-loops -finline-functions -Wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -MT color.lo -MD -MP -MF .deps/color.Tpo -c color.c  -fPIC -DPIC -o .libs/color.o
    color.c: In function 'vscale_chroma_line':
    color.c:498: error: invalid lvalue in increment
    color.c:499: error: invalid lvalue in increment
    make[3]: *** [color.lo] Error 1
    make[3]: Leaving directory `/home/notroot/xine-lib-1.0.1/src/xine-utils'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/notroot/xine-lib-1.0.1/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/notroot/xine-lib-1.0.1'
    make: *** [all] Error 2
    [notroot@localhost xine-lib-1.0.1]$
    Often when I try to compile something with GCC4 I get an error simalar to that, but the package compiles fine in GCC 3.4. Does anyone else get this and is there any way to stop it?

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Can you post a piece of code that gives you that error?
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028
    From color.c
    static void vscale_chroma_line (unsigned char *dst, int pitch,
    unsigned char *src1, unsigned char *src2, int width) {

    unsigned int t1, t2;
    unsigned int n1, n2, n3, n4;
    unsigned int *dst1, *dst2;
    int x;

    dst1 = (unsigned int *) dst;
    dst2 = (unsigned int *) (dst + pitch);

    /* process blocks of 4 pixels */
    for (x=0; x < (width / 4); x++) {
    n1 = *(((unsigned int *) src1)++);
    n2 = *(((unsigned int *) src2)++);

    n3 = (n1 & 0xFF00FF00) >> 8;
    n4 = (n2 & 0xFF00FF00) >> 8;
    n1 &= 0x00FF00FF;
    n2 &= 0x00FF00FF;

    t1 = (2*n1 + 2*n2 + 0x20002);
    t2 = (n1 - n2);
    n1 = (t1 + t2);
    n2 = (t1 - t2);
    t1 = (2*n3 + 2*n4 + 0x20002);
    t2 = (n3 - n4);
    n3 = (t1 + t2);
    n4 = (t1 - t2);

    *(dst1++) = ((n1 >> 2) & 0x00FF00FF) | ((n3 << 6) & 0xFF00FF00);
    *(dst2++) = ((n2 >> 2) & 0x00FF00FF) | ((n4 << 6) & 0xFF00FF00);
    }

    /* process remaining pixels */
    for (x=(width & ~0x3); x < width; x++) {
    n1 = src1[x];
    n2 = src2[x];

    dst[x] = (3*n1 + n2 + 2) >> 2;
    dst[x+pitch] = (n1 + 3*n2 + 2) >> 2;
    }
    }
    The red lines are lines 498 and 499 that gave the error.

    The spacing is wierd because I put it in quote tags so the bold and red tags actually did something.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Sep 2003
    Location
    St.Charles, Missouri, USA
    Posts
    201
    I dont have much C experience but it seems to me that you cant have 'unsigned int' where it is. I think that you have to delcare a variable and put it there for it to work correctly. The way I would fix it is like this:
    static void vscale_chroma_line (unsigned char *dst, int pitch,
    unsigned char *src1, unsigned char *src2, int width) {

    unsigned int t1, t2;
    unsigned int n1, n2, n3, n4;
    unsigned int *dst1, *dst2;
    int x;

    dst1 = (unsigned int *) dst;
    dst2 = (unsigned int *) (dst + pitch);

    /* process blocks of 4 pixels */
    /*for (x=0; x < (width / 4); x++) {
    n1 = *(((unsigned int *) src1)++);
    n2 = *(((unsigned int *) src2)++);
    n3 = (n1 & 0xFF00FF00) >> 8;
    n4 = (n2 & 0xFF00FF00) >> 8;
    n1 &= 0x00FF00FF;
    n2 &= 0x00FF00FF;

    t1 = (2*n1 + 2*n2 + 0x20002);
    t2 = (n1 - n2);
    n1 = (t1 + t2);
    n2 = (t1 - t2);
    t1 = (2*n3 + 2*n4 + 0x20002);
    t2 = (n3 - n4);
    n3 = (t1 + t2);
    n4 = (t1 - t2);

    *(dst1++) = ((n1 >> 2) & 0x00FF00FF) | ((n3 << 6) & 0xFF00FF00);
    *(dst2++) = ((n2 >> 2) & 0x00FF00FF) | ((n4 << 6) & 0xFF00FF00);
    }*/

    /* process remaining pixels */
    for (x=(width & ~0x3); x < width; x++) {
    n1 = src1[x];
    n2 = src2[x];

    dst[x] = (3*n1 + n2 + 2) >> 2;
    dst[x+pitch] = (n1 + 3*n2 + 2) >> 2;
    }
    }
    With the changes i made in bold. That should compile but you might loose the functionality of modifying 4 pixel blocks. Maybe the 'process remaining pixels' will catch them.
    Powered by Gentoo
    never ever ever use the hardened option in make.conf!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •