Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!aero!aerospace.aero.org!jordan From: jordan@aerospace.aero.org (Larry M. Jordan) Newsgroups: comp.lang.c++ Subject: Naming nested declarations Message-ID: <98561@aerospace.AERO.ORG> Date: 29 Jan 91 00:37:08 GMT Sender: news@aerospace.aero.org Reply-To: jordan@antares.UUCP (Larry M. Jordan) Organization: The Aerospace Corporation, El Segundo, CA Lines: 32 Given the following declaration: struct NODE; typedef NODE *LVAL; struct NODE { char n_type; char n_flags; union ninfo { struct cons { LVAL xl_car; LVAL xl_cdr; } n_cons; struct vector { unsigned length; LVAL *xv_data; } n_vector; ... } n_info; }; which of the following is "correct": [1] int i = sizeof(NODE::ninfo); [2] int i = sizeof(union ninfo); ? Well, Zortech v2.1 can handle [2], but produces an error for [1]. While another vendor can handle [1], but chokes on [2]. Whose right? What does the ARM say?