https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60304 --- Comment #21 from Jonathan Wakely --- (In reply to Manuel López-Ibáñez from comment #19) > This is exactly what G++'s stdbool.h is doing with -std=gnu++98 and > -std=c++98. is a "header" which is C++ standardese for a standard library header. The rule only applies to user code, not std::lib headers. In your testcase sys.h is OK but nonsys.h is not. Although you can argue that since is not defined by the C++98 standard it is not a "header" and must not define the macro in __STRICT_ANSI__ mode. > (Also, why is this not an error with -std=c++11 -pedantic-errors?) Because noone has ever implemented the diagnostic. Note that it only applies to user-code that includes a "header" so it's OK to define macros using the names of keywords as long as you never include a standard header. That makes it a bit more complicated to implement the diagnostic. >From gcc-bugs-return-464931-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Oct 24 14:51:36 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 26415 invoked by alias); 24 Oct 2014 14:51:36 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 26360 invoked by uid 48); 24 Oct 2014 14:51:33 -0000 From: "y.gribov at samsung dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/63638] [4.9 Regression] internal compiler error: in asan_expand_check_ifn (with -fsanitize­dress) Date: Fri, 24 Oct 2014 14:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: y.gribov at samsung dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg01952.txt.bz2 Content-length: 760 https://gcc.gnu.org/bugzilla/show_bug.cgi?idc638 Yury Gribov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |y.gribov at samsung dot com --- Comment #1 from Yury Gribov --- Created attachment 33803 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3803&actioníit Proposed patch Thanks, I was aware of this problem. For GCC 5.0 Maxim is going to fix this with his dont-sanitize-builtins patch (currently reviewed in gcc-patches). Here is a trivial patch for 4.9 but I only had time to perform short regtesting (make check RUNTESTFLAGS=asan.exp).