public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* expalin this syntax pls
@ 2002-10-17 23:32 Nathan .
  2002-10-18  4:23 ` Jim Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan . @ 2002-10-17 23:32 UTC (permalink / raw)
  To: gcc

Hello All,

Is it correct to leave a space in declaring args to following function. This 
has been cut paste from  file  /usr/include/netdb.h.
Quite surprisingly there is no compilation error but please explain me this 
novel syntax. All these lines have a space ..looks a space if not some 
invisible character. plz expalin this anomally. e.g there is a space between 
__restrict and __name ..

======= from /usr/include/netdb.h ===================
extern int gethostbyname_r (__const char *__restrict __name,   <<<<see this 
line
                            struct hostent *__restrict __result_buf,        
<<<<see this line
                            char *__restrict __buf, size_t __buflen,
                            struct hostent **__restrict __result,            
  <<<<see this line
                            int *__restrict __h_errnop) __THROW;

==================================================


Thanks for ur patience
Please Advise,
-Nitin








_________________________________________________________________
Get faster connections -- switch to MSN Internet Access! 
http://resourcecenter.msn.com/access/plans/default.asp

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: restrict keyword [was: expalin this syntax pls]
@ 2002-10-19 10:17 Erik Schnetter
  0 siblings, 0 replies; 8+ 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] 8+ messages in thread

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-17 23:32 expalin this syntax pls Nathan .
2002-10-18  4:23 ` 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
2002-10-19 10:17 Erik Schnetter

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).