[Bug c++/13983] no warning on some non-POD struct with packed attribute

mdorey at bluearc dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 16 04:31:00 GMT 2006



------- Comment #8 from mdorey at bluearc dot com  2006-03-16 04:31 -------
(In reply to comment #5)
> Nathan could you comment on this bug.

Two years with no comment.  Is it because the Severity is set to Enhancement? 
I'm convinced that the warning is incorrect, not missing, so I think the
Severity should be Normal and (perhaps) the Summary shouldn't say "no warning".

Perhaps another example would help to convince:

martind@duezer:~/playpen$ cat ignoring-packed.cpp 
template <typename T>
struct A {
    A();
} __attribute__((packed));

typedef A<int> B;

struct C {
  //A<int> a;
  B b;
} __attribute__((packed));
martind@duezer:~/playpen$ g++-4.0 -c ignoring-packed.cpp 
ignoring-packed.cpp:10: warning: ignoring packed attribute on unpacked non-POD
field ?B C::b?
martind@duezer:~/playpen$ 

With gcc version 4.0.3 (Debian 4.0.3-1).

The commented-out line compiles fine, though it should be equivalent to the
following line - the one which fails to compile.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13983



More information about the Gcc-bugs mailing list