From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11901 invoked by alias); 12 Jun 2007 17:18:55 -0000 Received: (qmail 11888 invoked by uid 22791); 12 Jun 2007 17:18:52 -0000 X-Spam-Check-By: sourceware.org Received: from dessent.net (HELO dessent.net) (69.60.119.225) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Jun 2007 17:18:49 +0000 Received: from localhost ([127.0.0.1] helo=dessent.net) by dessent.net with esmtp (Exim 4.50) id 1HyA11-0003uv-3B; Tue, 12 Jun 2007 17:18:47 +0000 Message-ID: <466ED576.E8F40C36@dessent.net> Date: Tue, 12 Jun 2007 17:27:00 -0000 From: Brian Dessent Reply-To: gcc-help@gcc.gnu.org X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: Nick Maclaren CC: gcc-help@gcc.gnu.org Subject: Re: sizeof( function ) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg00156.txt.bz2 Nick Maclaren wrote: > But this is actually a BUG in gcc - look at 5.1.1.3. The restriction > that sizeof may not have an argument that is function type is a > constraint, and therefore a breach requires a diagnostic. It would only be a bug if there was no diagnostic in non-GNU mode, e.g. -std=c89. Otherwise the default is -std=gnu89 if not specified and as the other poster pointed out, GNU extensions allow this and define the return value as 1 for convenience. Brian