This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: restrict keyword [was: expalin this syntax pls]


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]