Re: More proof of errors going uncorrected among the "regs"



Tim Rentsch wrote:
Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxxx> writes:

pete wrote:
I meant that I would have recognized
int array[];
as a valid example
of a declaration of an object with incomplete type.

I've worked with code that had an array declared like that.
The object was defined in another translation unit.
This is one of those areas of the language where my
footing is a little uncertain, but I think that a translation
unit containing `int array[];' at file scope and with no
further declaration of `array' is in error, and a diagnostic
is required.

I think not. For 'static int array[];', yes. Without the
static, there is the example in 6.9.2 p 5:

EXAMPLE 2 If at the end of the translation unit containing

int i[];

the array i still has incomplete type, the implicit initializer causes
it to have one element, which is set to zero on program startup.

Hmm. Well, as I said, "This is one of those areas of the
language where my footing is a little uncertain." Looks like
it was a good thing I said so ...

--
Eric.Sosman@xxxxxxx


--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.



Relevant Pages

  • why cant array forward declarations be static?
    ... An array can be declared and used without the size being known, ... int get_foo ... The full definition can also come later in the same source file: ... that the forward declaration with static is perfectly reasonable although ...
    (comp.lang.c.moderated)
  • Re: Finding a perfect number.
    ... That's really an algorithm question, ... several numbers you expect to use to populate the array in step 3. ... int number, i, split, total; ... declaration of arrays with a length which is dynamically determined. ...
    (comp.lang.c)
  • Re: Implicit int
    ... compile or implement, or even would have been in the 1970s. ... note that if you can't declare an array of size "n", ... could not already do with long int, had they chosen so to do. ... I recognise that this is not a popular view, but if the declaration is ...
    (comp.std.c)
  • Re: Another C# marshaling question
    ... You will also have to change your function declaration to: ... public static extern int FF_Function( ... Then, what you have to do on return is marshal the array, like so: ... > public class FF_AO_OrderList ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: pointer to an int array
    ... ("array of int of unknown size"). ... pointer to incomplete type (again, this is not a constraint violation, ...
    (comp.lang.c)