MESSAGE
DATE | 2011-06-11 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Using sizeof in the preprocessor
|
From owner-hangout-outgoing-at-mrbrklyn.com Sat Jun 11 01:04:46 2011 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 22952FFAD0; Sat, 11 Jun 2011 01:04:46 -0400 (EDT) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 5B63CFFAD3; 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 27E24100B05 for ; Sat, 11 Jun 2011 01:04:44 -0400 (EDT) Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 6C537320D9 for ; Sat, 11 Jun 2011 01:04:41 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 20529) id 5A00B33C5F; Sat, 11 Jun 2011 01:04:41 -0400 (EDT) From: Ruben Safir To: hangout-at-nylxs.com Subject: [NYLXS - HANGOUT] (fwd) Using sizeof in the preprocessor User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386)) Message-Id: <20110611050441.5A00B33C5F-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 -- Content-Type: text/plain; charset="ISO-8859-1" From: Johannes Schaub Reply-To: schaub.johannes-at-googlemail.com Date: Sat, 21 May 2011 15:35:53 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Newsgroups: comp.lang.c++ Subject: Using sizeof in the preprocessor Followup-To: comp.lang.c++ MIME-Version: 1.0 Lines: 12 Message-ID: <4dd7bfa5$0$7624$9b4e6d93-at-newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 21 May 2011 15:35:33 CEST NNTP-Posting-Host: 7825a840.newsspool1.arcor-online.net X-Trace: DXC=KhPclBcGnNL78PK[oJ2ng-at-ic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgB-at-FEQ;Q4I-at-5H8nF`Ooo-at-laC<RM4XCEm1:ZIQbMX-Complaints-To: usenet-abuse-at-arcor.de Path: reader1.panix.com!panix!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news.in2p3.fr!in2p3.fr!feed.ac-versailles.fr!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Xref: panix comp.lang.c++:1085095
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.
Can anybody please explain this? Is it a compiler bug? Thanks to all!
-- end of forwarded message --
|
|