GCC seems to have taken the view that compound expressions are permitted as the
2nd argument to offsetof.  However the implementor of the grammar forgot that
-> could be used.

#include <stddef.h>
struct s
{
  struct { float f; } sa[2];
};
enum { e = offsetof (struct s, sa->f) };


-- 
           Summary: offsetof buglet
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: neil at gcc dot gnu dot org


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

Reply via email to