From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2000 invoked by alias); 30 Dec 2002 22:39:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 1986 invoked from network); 30 Dec 2002 22:39:04 -0000 Received: from unknown (HELO Xenon.Stanford.EDU) (171.64.66.201) by 209.249.29.67 with SMTP; 30 Dec 2002 22:39:04 -0000 Received: from mail by Xenon.Stanford.EDU with spam-scanned (Exim 4.10) id 18T8Yd-0004Ts-00 for gcc@gcc.gnu.org; Mon, 30 Dec 2002 14:38:52 -0800 Received: from lindholm (helo=localhost) by Xenon.Stanford.EDU with local-esmtp (Exim 4.10) id 18T8Yc-0004Tk-00 for gcc@gcc.gnu.org; Mon, 30 Dec 2002 14:38:50 -0800 Date: Mon, 30 Dec 2002 20:53:00 -0000 From: Stephen Lindholm To: gcc@gcc.gnu.org Subject: Change in preprocessor behavior Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-74.4 required=7.0 tests=AWL,SPAM_PHRASE_00_01,USER_AGENT_PINE version=2.43-cdscf X-Spam-Level: X-SW-Source: 2002-12/txt/msg01605.txt.bz2 The stringize and token-pasting operators seem to no longer work in the "cpp" phases of compilation, but they worked in "cpp" in early versions of gcc (2.95.3). I can't find it written that those operations must occur in phases 1-4, but # and ## are "preprocessing-op-or-punc" and it would seem that they should therefore be processed in phase 4. Am I doing something wrong? Using this example from the cpp info page: #define COMMAND(NAME) { #NAME, NAME ## _command } struct command commands[] = { COMMAND (quit), COMMAND (help), }; I get this as expected on an old version of cpp (2.95.3): Xenon > cpp test2 # 1 "test2" struct command commands[] = { { "quit", quit_command } , { "help", help_command } , }; and this on a new version of cpp (3.1): thrush:~% cpp test2 # 1 "test2" struct command commands[] = { { #quit, quit ## _command }, { #help, help ## _command }, };