Summary: | top const stripped in structs for C | ||
---|---|---|---|
Product: | gcc | Reporter: | Mike Stump <mikestump> |
Component: | c | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | gcc-bugs, jsm28 |
Priority: | P2 | Keywords: | wrong-debug |
Version: | 4.0.0 | ||
Target Milestone: | 4.0.0 | ||
Host: | Target: | powerpc-darwin | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2005-01-25 03:43:48 |
Description
Mike Stump
2004-10-26 23:24:01 UTC
For reference, the C++ version: struct ssc { char * const ptr; ssc () :ptr(0) { } }; struct ss { char * ptr; }; int main () { struct ssc xssc; struct ss xss; } and its output: (gdb) ptype xss type = struct ss { char *ptr; } (gdb) ptype xssc type = class ssc { public: char * const ptr; ssc(ssc const&); ssc(); } Confirmed. My patch <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg02180.html> should cause fields to be given the correct types within the C front end, and might thereby fix this bug. Could someone with a Darwin build to hand check whether this bug is indeed fixed as I suggest in my previous comment? Confirmed as fixed: (gdb) ptype xss type = struct ss { char *ptr; } (gdb) ptype xssc type = struct ssc { char * const ptr; } |