Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #103538
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Using fread function |
| Date | 2017-02-09 09:19 -0800 |
| Organization | None to speak of |
| Message-ID | <lnwpczxowx.fsf@kst-u.example.com> (permalink) |
| References | (2 earlier) <kfnefzhd13n.fsf@x-alumni2.alumni.caltech.edu> <05a6afe0-d7db-4877-a244-1c5c7bc8e928@googlegroups.com> <kfn37fn7ve2.fsf@x-alumni2.alumni.caltech.edu> <28dc26c8-8063-4334-9850-b1a5ba7876f3@googlegroups.com> <d0e4b764-cef7-41d1-af6c-9b71a2ae323c@googlegroups.com> |
supercat@casperkitty.com writes:
> On Thursday, February 9, 2017 at 7:40:00 AM UTC-6, james...@verizon.net wrote:
>> It's rather peculiar that, like function parameter names, qualifiers
>> on parameters in a non-defining prototype are permitted but
>> meaningless. I believe that they were permitted, so that the same
>> prototype could be used for the declaration and the
>> definition. However, because they are meaningless, it's not mandatory
>> for the declaration and the definition to have prototypes that match
>> in those ways. It could have been mandatory; the standard goes out of
>> it's way to make it not mandatory, so that was clearly deliberate.
>
> I also find it peculiar that the Standard doesn't require that
> implementations do anything useful with qualifiers like "restrict" and
> "register" but requires that even implementations where they serve no
> purpose must still go through the effort of validating them. In cases
> where many or all implementations' natural behavior in the absence of a
> qualifier would match the required behavior with the qualifier, but
> either:
>
> (1) the qualifier could allow implementations to generate more efficient
> code, or
>
> (2) the qualifier could make the code usable on platforms that were
> capable of supporting the behavior at some cost but didn't do so by
> default
>
> allowing implementations that naturally support the required behavior to
> "support" the qualifier by simply it would minimize the burden the qualifier
> would place upon implementations.
I think you accidentally a word. Did you mean "by simply *ignoring*
it"? If so, what exactly do you mean by that?
Are you suggesting that an implementation that doesn't do anything
useful with "restrict" should be able to ignore it altogether, so that
int n = restrict 42;
would be quietly treated as a valid declaration? Or that an
implementation that ignores register should allow the address of a
register-qualified object to be taken?
If so, why?
If I write code that uses "register" or "restrict", I want my compiler
to check my code for validity, whether they have any semantic impact or
not.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Using fread function janus <emekamicro@gmail.com> - 2017-01-29 10:07 -0800
Re: Using fread function "James R. Kuyper" <jameskuyper@verizon.net> - 2017-01-29 14:31 -0500
Re: Using fread function supercat@casperkitty.com - 2017-01-30 08:03 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-01 13:59 -0800
Re: Using fread function jameskuyper@verizon.net - 2017-02-05 11:40 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-08 22:04 -0800
Re: Using fread function jameskuyper@verizon.net - 2017-02-09 05:39 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-09 07:47 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-09 09:19 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-09 09:55 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-09 12:10 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-09 13:01 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-12 09:36 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-12 10:52 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-19 21:19 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-20 09:35 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-20 09:52 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-20 11:15 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-20 11:45 -0800
Re: Using fread function "James R. Kuyper" <jameskuyper@verizon.net> - 2017-02-20 15:38 -0500
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-23 12:12 -0800
Re: Using fread function jameskuyper@verizon.net - 2017-02-24 10:37 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-23 05:04 -0800
Re: Using fread function supercat@casperkitty.com - 2017-02-23 07:58 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-25 11:48 -0800
Re: Using fread function jameskuyper@verizon.net - 2017-02-25 13:44 -0800
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-17 13:12 -0700
Re: Using fread function supercat@casperkitty.com - 2017-04-17 13:50 -0700
Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-12 09:31 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-01-29 13:14 -0800
Re: Using fread function Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-01-30 08:18 -0800
Re: Using fread function supercat@casperkitty.com - 2017-01-30 08:44 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-01-30 11:58 -0800
Re: Using fread function Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-01-30 13:05 -0800
Re: Using fread function supercat@casperkitty.com - 2017-01-30 13:39 -0800
Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-01-30 13:57 -0800
csiph-web