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]
Other format: [Raw text]

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



------- 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


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