This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: restrict keyword [was: expalin this syntax pls]
- From: Erik Schnetter <schnetter at uni-tuebingen dot de>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 19 Oct 2002 09:50:37 +0200
- Subject: Re: restrict keyword [was: expalin this syntax pls]
- Organization: Theoretische Astrophysik Tuebingen
You can't issue a hard error for it anyway, since the code might never
be executed. The key questions for issuing a warning (under its own
option, possibly included in -Wall) are:
* Can working code wrongly triggering the warning be easily changed,
even if automatically generated, so as not to trigger it? (The
relevant question for -Wall inclusion.)
If I had to translate a Fortran procedure to C, I would very likely
declare all arguments as restricted pointers. I think that the
definition of "restrict" in C and of non-aliasing in Fortran are close
enough to make that worthwhile. This would not be possible if "-Wall"
included a warning for passing the same pointer several times to a
procedure.
There might also an updated version of "f2c" be written at some time.
-erik
--
Erik Schnetter <schnetter@uni-tuebingen.de>