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: C declarations Date: Wed, 01 Feb 2017 08:08:46 -0800 Organization: None to speak of Lines: 34 Message-ID: References: <3fd6c360-cd60-4d22-b7c6-4ac75ab206c3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="d1c2f4f3e96755a2d9129a8b0bf9863b"; logging-data="641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zZC2nb2axRgKqTnI41Z9w" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:3JOAPvdkoWDGOp4xj6f9VwmyuL0= sha1:F+brgdH8avQo2KXp8fpIOKgtM6o= Xref: csiph.com comp.lang.c:102908 BartC 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 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"