static and forward declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

In Gimp source code, there are many lines like

---------------------------------------------------------

static ProcRecord channel_ops_offset_proc;
static ProcRecord channel_ops_duplicate_proc;

...

void
register_channel_ops_procs (void)
{
  procedural_db_register (&channel_ops_offset_proc);
  procedural_db_register (&channel_ops_duplicate_proc);
}

...

static ProcRecord channel_ops_offset_proc =
{
...
}

static ProcRecord channel_ops_duplicate_proc =
{
...
}
---------------------------------------------------------

It seems that the first 2 lines are 'forward declarations', before the
variable definitions.
My compiler (CodeWarrior) says "illegal redefinition", which is the normal
behavior for me.

How can this code compile with gcc ?
Is it allowed by the standard ?




[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux