MESSAGE
DATE | 2011-06-11 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: Using sizeof in the preprocessor
|
From owner-hangout-outgoing-at-mrbrklyn.com Sat Jun 11 01:04:48 2011 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 383E9100B07; Sat, 11 Jun 2011 01:04:47 -0400 (EDT) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 409DE100B0B; Sat, 11 Jun 2011 01:04:45 -0400 (EDT) Delivered-To: hangout-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by www2.mrbrklyn.com (Postfix) with ESMTP id 1E0E3FFAD0 for ; Sat, 11 Jun 2011 01:04:43 -0400 (EDT) Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id F35CB320DD for ; Sat, 11 Jun 2011 01:04:41 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 20529) id E190133C5F; Sat, 11 Jun 2011 01:04:41 -0400 (EDT) From: Ruben Safir To: hangout-at-nylxs.com Subject: [NYLXS - HANGOUT] (fwd) Re: Using sizeof in the preprocessor User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386)) Message-Id: <20110611050441.E190133C5F-at-panix2.panix.com> Date: Sat, 11 Jun 2011 01:04:41 -0400 (EDT) Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-mrbrklyn.com
-- forwarded message -- Path: reader1.panix.com!panix!usenet.stanford.edu!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 21 May 2011 09:37:00 -0500 From: Pete Becker Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Sat, 21 May 2011 10:37:00 -0400 Message-ID: <2011052110370061214-pete-at-versatilecodingcom> References: <4dd7bfa5$0$7624$9b4e6d93-at-newsspool1.arcor-online.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: Using sizeof in the preprocessor User-Agent: Unison/2.1.4 Lines: 24 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-fErqju4cpSO7xnm/f4yxTUXamk1w0o9tkzaCrkRkQtr5ZHmWvaomac55L/rNra+FlblzFgpR7ETQKD7!MxQPEzsBqs4/aBvcFqU7jX1qp7dh24GJOoIriGN5+iCnF+vfU9nGxfvrcUGX7Yt6JXaMJozv X-Complaints-To: abuse-at-giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1749 Xref: panix comp.lang.c++:1085108
On 2011-05-21 10:08:58 -0400, Huibert Bol said:
> Johannes Schaub wrote: > >> I have this code in my pet project >> >> #if sizeof -1 > 4 >> #error "This doesn't work on 64bit" >> #endif >> >> My friend was telling me that this shouldn't work because "sizeof is not >> evaluated in the preprocessor". Yet the compiler accepts it and my program >> works. > > Identifiers in #if expressions are evaluated as zero,
Good point.
-- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)
-- end of forwarded message --
|
|