From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17501 invoked by alias); 29 Aug 2014 12:12:13 -0000 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 Received: (qmail 17474 invoked by uid 89); 29 Aug 2014 12:12:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 29 Aug 2014 12:12:06 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id s7TCC2Ja005700; Fri, 29 Aug 2014 07:12:02 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id s7TCC2pJ005699; Fri, 29 Aug 2014 07:12:02 -0500 Date: Fri, 29 Aug 2014 12:12:00 -0000 From: Segher Boessenkool To: =?utf-8?Q?J=C4=99drzej?= Dudkiewicz Cc: Jonathan Wakely , Michael Williamson , gcc-help Subject: Re: odd behavior Message-ID: <20140829121201.GA4468@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00139.txt.bz2 [Please don't top-post. Thanks.] > > #if 0 > > const char* s = "; > > #endif > > int main() { } > Ah-ha! You're right. Now I see that this warning is issued by > preprocessor, not by compiler. Now that I think about it, it seems > logical. Preprocessor has to tokenize input to perform substitutions > and such, so even if code isn't meant for compiler, it must follow > some rules - ifdefined parts of code are not comments. Is that right? C11 6.4/3 says the lonely quote is undefined behaviour. Your program might or might not work (the same) with a different (version of the) compiler. So a warning is good. Segher