From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21521 invoked by alias); 1 Oct 2009 22:08:17 -0000 Received: (qmail 21468 invoked by uid 48); 1 Oct 2009 22:08:05 -0000 Date: Thu, 01 Oct 2009 22:08:00 -0000 Subject: [Bug preprocessor/41540] New: -dM -E doesn't #define __FILE__ X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "msebor at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg00068.txt.bz2 The documentation for the -dM -E option states that "Instead of the normal output, generate a list of `#define' directives for all the macros defined during the execution of the preprocessor, including predefined macros. This gives you a way of finding out what is predefined in your version of the preprocessor." but the predefined standard macro __FILE__ does not appear in the output (and neither does __LINE__): $ echo >t.c && gcc -dM -E t.c | grep __FILE__ || echo "__FILE__ not #defined" __FILE__ not #defined $ I believe __FILE__ should always appear in the output. Since __LINE__ changes its value from line to line it should either be documented as not being output at all or, perhaps preferably, it should be output with the value of 0. -- Summary: -dM -E doesn't #define __FILE__ Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: msebor at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41540