Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Why I use gcc Date: Fri, 07 Oct 2016 12:25:32 -0700 Organization: None to speak of Lines: 24 Message-ID: References: <046cb5f6-3629-4320-a71e-8a3e9420cc01@googlegroups.com> <7ab1eac2-0132-4b4d-9a03-bc92cd50579b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="16484"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AWuUQr97SZH+3VpLDATFn" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:CVVfqYUMG4F4Edxi8urAoVRYQ5o= sha1:w+za8yaoE/YaHdgSS8Yr7sHlres= Xref: csiph.com comp.lang.c:94567 BartC writes: [...] > Type-qualifiers seem be 'const' and 'volatile'. Trouble is I've no idea > where they go either! Especially in relation to functions as they > wouldn't make sense there. [...] The type qualifiers are const, restrict, volatile, and _Atomic. The grammar permits "const", for example, on a function type: const int func(void); but it's ignored. (I think the same is true for the other type qualifiers, but I haven't checked.) But a function returning a pointer-to-const is perfectly sensible: const int *func(void); -- Keith Thompson (The_Other_Keith) kst-u@mib.org 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"