https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82909

            Bug ID: 82909
           Summary: Scope of type defined by offsetof() macro
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tydeman at tybor dot com
  Target Milestone: ---

/*
 * C standard appears to be unclear on scope of new type defined in
 * offsetof() macro.  Some compilers accept; some reject.
 * This is related to C Defect Report 496.
 */

#include <stddef.h>     /* offsetof() */

int main(void){

  if( 0 == (int)offsetof( struct s4 {int i4;}, i4 ) ){
    struct s4 s43;      /* OK here */
  }
  {
    struct s4 s44;      /* Should(?) be OK here */
  }

  return 0;
}

Reply via email to