Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #102908
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: C declarations |
| Date | 2017-02-01 08:08 -0800 |
| Organization | None to speak of |
| Message-ID | <lnbmul99m9.fsf@kst-u.example.com> (permalink) |
| References | (5 earlier) <efdemaFhgsiU2@mid.individual.net> <o6s8i9$cuj$1@dont-email.me> <o6sha6$a6l$1@dont-email.me> <o6slob$pkf$1@dont-email.me> <o6snb9$v37$1@dont-email.me> |
BartC <bc@freeuk.com> writes:
[...]
> (I notice you shouldn't use _Complex by itself, but have to combine it
> with float or double, which I hadn't realised. Yet usually you can. More
> laxity on the part of compilers.)
That is unfortunate.
With gcc 6.2, this:
_Complex x;
compiles with no warning by default. With "-pedantic", it warns:
warning: ISO C does not support plain ‘complex’ meaning ‘double complex’ [-Wpedantic]
C90 did not have complex at all. C99, which introduced the _Complex
keyword, did not permit it by itself; it's a type specifier that has to
be associated with "float", "double", or "long double". There is no
standard version of the language in which that declaration is valid.
My guess is that it was proposed as equivalent to `double _Complex` some
time during the development of the C99 standard, and gcc implemented
support for it.
IMHO gcc *should* at least warn about it by default. But then you
probably shouldn't invoke gcc with default arguments if you care about
catching errors in your code.
--
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
C declarations BartC <bc@freeuk.com> - 2017-01-30 13:00 +0000
Re: C declarations David Brown <david.brown@hesbynett.no> - 2017-01-30 14:25 +0100
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-01-30 11:42 -0800
Re: C declarations Andrey Tarasevich <andreytarasevich@hotmail.com> - 2017-01-31 13:46 -0800
Re: C declarations BartC <bc@freeuk.com> - 2017-01-31 22:13 +0000
Re: C declarations Andrey Tarasevich <andreytarasevich@hotmail.com> - 2017-01-31 16:43 -0800
Re: C declarations Andrey Tarasevich <andreytarasevich@hotmail.com> - 2017-01-31 17:06 -0800
Re: C declarations Ian Collins <ian-news@hotmail.com> - 2017-02-01 17:58 +1300
Re: C declarations luser droog <luser.droog@gmail.com> - 2017-01-31 22:42 -0800
Re: C declarations Ian Collins <ian-news@hotmail.com> - 2017-02-01 19:48 +1300
Re: C declarations Robert Wessel <robertwessel2@yahoo.com> - 2017-02-01 01:18 -0600
Re: C declarations David Brown <david.brown@hesbynett.no> - 2017-02-01 10:10 +0100
Re: C declarations BartC <bc@freeuk.com> - 2017-02-01 11:39 +0000
Re: C declarations David Brown <david.brown@hesbynett.no> - 2017-02-01 13:55 +0100
Re: C declarations BartC <bc@freeuk.com> - 2017-02-01 13:22 +0000
Re: C declarations David Brown <david.brown@hesbynett.no> - 2017-02-01 16:30 +0100
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-02-01 08:15 -0800
Re: C declarations supercat@casperkitty.com - 2017-02-01 08:44 -0800
Re: C declarations David Brown <david.brown@hesbynett.no> - 2017-02-01 20:56 +0100
Re: C declarations supercat@casperkitty.com - 2017-02-01 08:29 -0800
Re: C declarations BartC <bc@freeuk.com> - 2017-02-01 17:24 +0000
Re: C declarations fir <profesor.fir@gmail.com> - 2017-02-01 09:55 -0800
Re: C declarations BartC <bc@freeuk.com> - 2017-02-01 18:44 +0000
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-02-01 11:03 -0800
Re: C declarations fir <profesor.fir@gmail.com> - 2017-02-01 12:26 -0800
Re: C declarations fir <profesor.fir@gmail.com> - 2017-02-01 13:03 -0800
Re: C declarations fir <profesor.fir@gmail.com> - 2017-02-01 13:12 -0800
Re: C declarations fir <profesor.fir@gmail.com> - 2017-02-03 16:07 -0800
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-02-01 10:44 -0800
Re: C declarations jameskuyper@verizon.net - 2017-02-01 11:08 -0800
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-02-01 10:40 -0800
Re: C declarations BartC <bc@freeuk.com> - 2017-02-01 17:04 +0000
Re: C declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-02-01 19:58 +0000
Re: C declarations BartC <bc@freeuk.com> - 2017-02-01 21:23 +0000
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-02-01 08:08 -0800
Re: C declarations Andrey Tarasevich <andreytarasevich@hotmail.com> - 2017-02-01 12:45 -0800
Re: C declarations Andrey Tarasevich <andreytarasevich@hotmail.com> - 2017-03-06 11:19 -0800
Re: C declarations Keith Thompson <kst-u@mib.org> - 2017-03-06 11:27 -0800
csiph-web