[LLVMbugs] [Bug 10323] New: Incomplete support for -fplan9-extensions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 10 14:07:17 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10323

           Summary: Incomplete support for -fplan9-extensions
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tim.nieradzik at gmx.de
                CC: llvmbugs at cs.uiuc.edu


There are currently two issues with Clang's implementation of the Plan9
extensions:

- It must imply -fms-extensions so that a structure declared in a different
scope can be used like an unnamed structure.
- When passing the pointer of a structure to another function, Clang doesn't
select the correct member.

See also http://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html

#include <stdio.h>

struct s1 {
        int b;
};

struct s2 {
        int a;
        struct s1;
};

void f0(void *p) {
        printf("a=%p\n", p);
}

void f1(struct s1 *p) {
        printf("b=%p\n", &p->b);
}

void f2(struct s2 *p) {
        printf("a=%p b=%p\n", &p->a, &p->b);
        f0(p);
        f1(p);
}

int main(void) {
        struct s2 s;
        f2(&s);
        return 0;
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list