From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19599 invoked by alias); 29 Nov 2001 12:06:07 -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 19550 invoked by uid 71); 29 Nov 2001 12:06:04 -0000 Resent-Date: 29 Nov 2001 12:06:04 -0000 Resent-Message-ID: <20011129120604.19549.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Andreas Jaeger Received:(qmail 12047 invoked from network); 29 Nov 2001 11:56:50 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by hostedprojects.ges.redhat.com with SMTP; 29 Nov 2001 11:56:50 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 88C171E0FF for ; Thu, 29 Nov 2001 12:56:49 +0100 (MET) Message-Id:<200111291156.fATBun702960@gee.suse.de> Date: Wed, 21 Nov 2001 21:15:00 -0000 From: Andreas Jaeger To: gcc-gnats@gcc.gnu.org Cc: ma@suse.de X-Send-Pr-Version:3.113 Subject: c/4967: GCC should warn about obvious violations of restrict X-SW-Source: 2001-11/txt/msg00709.txt.bz2 List-Id: >Number: 4967 >Category: c >Synopsis: GCC should warn about obvious violations of restrict >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Thu Nov 29 04:06:03 PST 2001 >Closed-Date: >Last-Modified: >Originator: Andreas Jaeger >Release: 3.1 20011125 (experimental) >Organization: SuSE >Environment: System: Linux gee 2.2.19 #1 Mon Apr 30 20:46:41 GMT 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /cvs/gcc/configure --prefix=/opt/gcc-3.1-devel --enable-shared --enable-threads=posix --enable-clocale=gnu --with-gnu-as --with-gnu-ld --disable-nls --with-system-zlib --enable-languages=c,objc,c++,f77,java,ada >Description: The compiler should use the restrict keyword of ISO C99 when invoking functions and check that the aliasing rules are not violated on the call side. >How-To-Repeat: Compile this program - it should give a warning: int sprintf_restrict (char *restrict s, const char *restrict t) { return *s!=*t; } int main (void) { char buf[64]; sprintf_restrict (buf, buf); return 0; } $ /opt/gcc-3.1-devel/bin/gcc tt.c -Wall -O2 -std=c99 gives no warning. >Fix: >Release-Note: >Audit-Trail: >Unformatted: