This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/4967: GCC should warn about obvious violations of restrict
- From: Andreas Jaeger <aj at suse dot de>
- To: gcc-gnats at gcc dot gnu dot org
- Cc: ma at suse dot de
- Date: Thu, 29 Nov 2001 12:56:49 +0100
- Subject: c/4967: GCC should warn about obvious violations of restrict
[Get raw message]
>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: