From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31449 invoked by alias); 27 Sep 2005 15:14:45 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 31430 invoked by uid 22791); 27 Sep 2005 15:14:40 -0000 Received: from exprod6og2.obsmtp.com (HELO psmtp.com) (64.18.1.122) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Tue, 27 Sep 2005 15:14:40 +0000 Received: from source ([192.150.11.134]) by exprod6ob2.obsmtp.com ([64.18.5.12]) with SMTP; Tue, 27 Sep 2005 08:14:20 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j8RF79BM029579; Tue, 27 Sep 2005 08:07:09 -0700 (PDT) Received: from fe2.corp.adobe.com (fe2.corp.adobe.com [10.8.192.72]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j8RFEJn2010899; Tue, 27 Sep 2005 08:14:20 -0700 (PDT) Received: from namail3.corp.adobe.com ([10.8.192.66]) by fe2.corp.adobe.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 27 Sep 2005 08:14:19 -0700 Received: from 153.32.12.150 ([153.32.12.150]) by namail3.corp.adobe.com ([10.8.192.66]) via Exchange Front-End Server namailhost.corp.adobe.com ([10.8.192.72]) with Microsoft Exchange Server HTTP-DAV ; Tue, 27 Sep 2005 15:14:19 +0000 User-Agent: Microsoft-Entourage/11.2.0.050811 Date: Tue, 27 Sep 2005 15:14:00 -0000 Subject: Re: Problem with code or gcc? From: John Love-Jensen To: "Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA" , MSX to GCC Message-ID: In-Reply-To: <40B2C613F7E8684B96E5AB2560C9CC5B0134C7EC@NAWESDNSEX01VA.nadsuswe.nads.navy.mil> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SW-Source: 2005-09/txt/msg00188.txt.bz2 Hi Artur, > Shouldn't I get a linker error in those other cases? Not necessarily. You won't get a linker error if the actual numeric value can be used "as is", without referencing the variable it is associated with. Consider it an optimization of sorts. If you really dislike this situation[1], you can use enum for your integer constants in your struct. [1] I actually PREFER coding like in your example. But I know quite a few C++ software engineers that prefer using enums for constants instead -- they'd claim there are "less surprises". Both idioms will be supported by C++ for a very long time. Sincerely, --Eljay