public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: restrict keyword [was: expalin this syntax pls]
@ 2002-10-19 10:17 Erik Schnetter
  0 siblings, 0 replies; 6+ messages in thread
From: Erik Schnetter @ 2002-10-19 10:17 UTC (permalink / raw)
  To: gcc

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: expalin this syntax pls
@ 2002-10-18  4:23 Jim Wilson
  2002-10-18 14:27 ` restrict keyword [was: expalin this syntax pls] Joe Buck
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2002-10-18  4:23 UTC (permalink / raw)
  To: Nathan .; +Cc: gcc

restrict is a new keyword in ISO C99.  It is a type qualifier, like const
and volatile.  See the ISO C99 standard, or see a book that explains the
ISO C99 language.  This is the current version of the C language.  It became
a standard in 1999.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-10-19  7:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-19 10:17 restrict keyword [was: expalin this syntax pls] Erik Schnetter
  -- strict thread matches above, loose matches on Subject: below --
2002-10-18  4:23 expalin this syntax pls Jim Wilson
2002-10-18 14:27 ` restrict keyword [was: expalin this syntax pls] Joe Buck
2002-10-18 18:46   ` Joseph S. Myers
2002-10-18 21:53     ` Joe Buck
2002-10-18 21:55       ` Joseph S. Myers
2002-10-18 23:07   ` kwall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).