This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

problems building ddd-3.0.91 with egcs-1.1b on SuSE linux ('state' undeclared)


Hi, is this an egcs bug, or a ddd bug?

I've installed egcs-1.1b on a i586 box based on SuSE linux 5.1, with kernel 2.0.33,
gdb-4.17, binutils-2.9.1.0.15, lesstif-0.87.0,  (config.guess reports
i586-pc-linux-gnulibc1
) and am attempting a compile of ddd-3.0.91, which is supposed to support egcs.

It seems egcs barfs on sigName.C. Aside: ( egcs, binutils, lesstif, gdb, and ddd were
all configured as follows: "./configure --prefix=/usr/bleeeding/static
--disable-shared", but the exact same problem occurs for the shared library versions
also ).


c++  -DHAVE_CONFIG_H -DNDEBUG -O2 -g -W -Wall -Wno-uninitialized -fexternal-templates
-felide-constructors -fconserve-space -c -I. -I. -I./.. -I/usr/bleeding/static/include
-I/usr/X11R6/include -o sigName.o sigName.C
sigName.C: In function `char * statusName(int)':
sigName.C:57: `state' undeclared (first use this function)
sigName.C:57: (Each undeclared identifier is reported only once
sigName.C:57: for each function it appears in.)
sigName.C:57: warning: ANSI C++ forbids declaration `__in' with no type
sigName.C:61: warning: ANSI C++ forbids declaration `__in' with no type
sigName.C:64: warning: ANSI C++ forbids declaration `__in' with no type
sigName.C:65: warning: ANSI C++ forbids declaration `__in' with no type
sigName.C:66: warning: ANSI C++ forbids declaration `__in' with no type
sigName.C:67: warning: ANSI C++ forbids declaration `__in' with no type
make[1]: *** [sigName.o] Error 1
make[1]: Leaving directory `/usr/bleeding/src/ddd-3.0.91/ddd'
make: *** [all] Error 1


hmm...
This occurs in the first if statement fo the statusName() function...


char *statusName(int state)
{
    if (WIFEXITED(state))
    {
        static char buffer[256];

        sprintf(buffer, "Exit %d", (int)WEXITSTATUS(state));
        return buffer;
    }
    else if (WIFSIGNALED(state))
        return sigName(WTERMSIG(state));
    else if (WIFSTOPPED(state))
        return sigName(WSTOPSIG(state));

    return "Unknown state change";
}


Looks okay to me... now if I stop it after the preprocess stage, I see this...

char *statusName(int state)
{
    if (((( (__extension__ ({ union { __typeof(  state  ) __in; int __i; } __u; __u.__in
= (  state  ); __u.__i; }))  ) & 0xff) == 0)  )
    {
        static char buffer[256];

        sprintf(buffer, "Exit %d", (int)((( (__extension__ ({ union { __typeof(  state
) __in; int __i; } __u; __u.__in = (  state  ); __u.__i; }))  ) & 0xff00) >> 8)  );
        return buffer;
    }
    else if ((((unsigned int)(( (__extension__ ({ union { __typeof(  state  ) __in; int
__i; } __u;     __u.__in = (  state  ); __u.__i; }))  )-1) & 0xFFFF) < 0xFF)  )
        return sigName((( (__extension__ ({ union { __typeof(  state  ) __in; int __i; }
__u;   __u.__in = (  state  ); __u.__i; }))  ) & 0x7f)  );
    else if (((( (__extension__ ({ union { __typeof(  state  ) __in; int __i; } __u;
__u.__in = (  state  ); __u.__i; }))  ) & 0xff) == 0x7f)  )
        return sigName((((  (__extension__ ({ union { __typeof(  state  ) __in; int __i;
} __u; __u.__in = (  state  ); __u.__i; }))   ) & 0xff00) >> 8)   );

    return "Unknown state change";
}


This same problem was reported by Markus Kossmann <markus.kossmann@inka.de> on
egcs-2.91.43 in July this year, but I never saw any followups. Any ideas? BTW, this also
manifests itself in the release version of ddd-3.0.


--
Paul Shields, mailto:shields@custodians.com

Custodian Software Inc. 962 Bloor Street West Toronto, Ontario M6H 1L6
Tel: +1 416 537-0015   Fax: +1 416 536-5793





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]