Skip to contentSkip to conversation

X server failing on PowerPC

DISCUSSION Gary Thomas 2 participants 2 messages May 16, 2012

lore
Share & tools
lore
#0 lore raw

When built from a recent OE-core using GCC 4.7.x, the X server fails on PowerPC targets. Filed as Poky/Yocto bug #2460, it boils down to a sequence of code like this:

   void *ptr;
   switch(XX) {
      case a:
         define_some_structure A;
         ptr = &A;
         break;
      case b:
         define_some_structure B;
         ptr = &B;
         break;
   }
   call_some_function(ptr);

I didn't explore how this messes up, just that it does when compiled on PowerPC with GCC 4.7.x. Note that it works fine on ARM (and I assume x86 as well)

Is this even legal C? even if it works [has worked] for 20+ years?

Should I propose my patch? I'm only interested in xserver-kdrive_1.7.99.2, but I think this probably affects all X server instances.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#1 lore raw
Quoted 13 lines · Gary Thomas
    void *ptr;
    switch(XX) {
       case a:
          define_some_structure A;
          ptr = &A;
          break;
       case b:
          define_some_structure B;
          ptr = &B;
          break;
    }
    call_some_function(ptr);
Quoted 3 lines

[...]

Is this even legal C?

No.

p.