Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #41353

Re: complex declarations

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: complex declarations
Date 2014-03-04 16:06 -0500
Organization Self
Message-ID <5316406C.9050905@verizon.net> (permalink)
References <lf5cdv$dll$1@dont-email.me> <53163C3C.8060203@verizon.net>

Show all headers | View raw


On 03/04/2014 03:49 PM, James Kuyper wrote:
,,,
> C function definitions can only occur at file scope (6.9p1). You can
> declare a function at block scope (6.8p2), but you can't define it
> there. Because you can't define it with block scope, I also personally
> feel it's a bad idea to declare it at file scope - but that's just a

"file" should have been "block" in that last sentence. That error almost
exactly reverses my intended meaning.

...
> Type names are also used in casts and sizeof() expressions. In C99,
> they're also used in compound literals. In C2011, they're also used in
> _Generic() associations, _Alignof() expressions, _Atomic() type
> specifiers, and _Alignas() specifiers.

I should also mention that function declarations are allowed to use type
names for the parameters; you're only required to name the parameters in
the function definition itself. This is not stated directly by the use
of the phrase "type name", but only implicitly by the fact that 6.7.6p1
does not require a parameter-declaration to contain a declarator, it can
use an abstract-declarator instead. That freedom is retracted for
function definitions (6.9.1p5).

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-04 20:18 +0000
  Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 15:49 -0500
    Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 16:06 -0500
      Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 12:18 +0000
        Re: complex declarations "BartC" <bc@freeuk.com> - 2014-03-05 12:56 +0000
          Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-05 08:24 -0500
            Re: complex declarations "BartC" <bc@freeuk.com> - 2014-03-05 16:26 +0000
        Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-05 08:13 -0500
          Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 13:32 +0000
        Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 14:32 +0000
    Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-04 21:42 +0000
      Re: complex declarations Keith Thompson <kst-u@mib.org> - 2014-03-04 14:04 -0800
        Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 09:22 +0000
          Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-05 07:29 -0500
            Re: complex declarations Keith Thompson <kst-u@mib.org> - 2014-03-05 08:38 -0800
      Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 17:05 -0500
  Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-04 21:15 +0000
    Re: complex declarations "BartC" <bc@freeuk.com> - 2014-03-04 21:38 +0000
      Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-04 23:27 +0000
    Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-04 21:59 +0000
      Re: complex declarations James Kuyper <jameskuyper@verizon.net> - 2014-03-04 17:12 -0500
      Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 00:28 +0000
        Re: complex declarations Robbie Brown <dac@nomail.invalid> - 2014-03-05 09:10 +0000
          Re: complex declarations Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-05 11:44 +0000

csiph-web