From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1447 invoked by alias); 15 Oct 2002 22:22:28 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 1424 invoked by uid 61); 15 Oct 2002 22:22:28 -0000 Date: Tue, 15 Oct 2002 15:22:00 -0000 Message-ID: <20021015222227.1423.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, meshko@scorch2000.com, nobody@gcc.gnu.org From: neil@gcc.gnu.org Reply-To: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, meshko@scorch2000.com, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c/8236: turning on optimization breaks preprocessor output X-SW-Source: 2002-10/txt/msg00599.txt.bz2 List-Id: Synopsis: turning on optimization breaks preprocessor output State-Changed-From-To: open->closed State-Changed-By: neil State-Changed-When: Tue Oct 15 15:22:27 2002 State-Changed-Why: Not a bug. Macro arguments are determined before arguments are macro-expanded. Glibc has a "feature" whereby if you specify optimization to GCC, it "optimizes" various library calls by making them into macros. It is quite entitled to do this, and so the bug is in your code. You can work around it by defining a macro #define my_strncmp(a, b, n) strncmp (a, b, n) and this extra level of indirection will work provided you use my_strncmp instead. Of course, this may introduce other issues. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8236