From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12218 invoked by alias); 24 Aug 2004 10:47:49 -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 12194 invoked from network); 24 Aug 2004 10:47:45 -0000 Received: from unknown (HELO psmtp.com) (12.158.35.214) by sourceware.org with SMTP; 24 Aug 2004 10:47:45 -0000 Received: from source ([192.150.22.7]) by exprod6ob4.obsmtp.com ([12.158.35.250]) with SMTP; Tue, 24 Aug 2004 03:47:44 PDT Received: from inner-relay-1.corp.adobe.com (inner-relay-1 [153.32.1.51]) by smtp-relay-7.sea.adobe.com (8.12.10/8.12.10) with ESMTP id i7OAlite019930 for ; Tue, 24 Aug 2004 03:47:44 -0700 (PDT) Received: from iplan-mn (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-1.corp.adobe.com (8.12.9/8.12.9) with ESMTP id i7OAliTk013551 for ; Tue, 24 Aug 2004 03:47:44 -0700 (PDT) Received: from mn-eljay-a51m.adobe.com ([130.248.178.96]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0I2Y005LY5ZIH4@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Tue, 24 Aug 2004 05:47:43 -0500 (CDT) Date: Tue, 24 Aug 2004 16:27:00 -0000 From: Eljay Love-Jensen Subject: g++ and null pointers X-Sender: eljay@iplan-mn.corp.adobe.com To: gcc-help@gcc.gnu.org Message-id: <6.1.2.0.2.20040824053102.01e9b890@iplan-mn.corp.adobe.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-SW-Source: 2004-08/txt/msg00220.txt.bz2 Hi everyone, GCC 3.3.1 on Cygwin When I compile this test.cpp source... // g++ -Wno-long-long -pedantic -Wall -W -c test.cpp #define NULL __null int main() { void* p; p = 0; p = 0u; p = 0ul; p = 0ull; p = 0l; p = 0ll; p = false; // silly... p = -0; p = -0u; p = -0ul; p = -0ull; p = -0l; p = -0ll; p = -false; // my druthers... p = NULL; return 0; } ...GCC is happy with all of these assignments. Are they all supposed (ISO 14882) to be legit? Some of them surprised me. The negated ones are just for fun. I didn't go completely crazy with the cheese whiz, and put in "!!0" and "+0" and hexadecimal, and octal, and various permutations of the [uUlL]* suffix. Sincerely, --Eljay